Preheat the oven to 375°F (190°C).
Slice the eggplants lengthwise into 1/4-inch thick slices.
Sprinkle salt on the slices and let them sit for 30 minutes to draw out moisture.
Rinse and pat dry the eggplant slices.
Brush the slices with olive oil and roast them in the oven for 25 minutes.
In a bowl, mix ricotta cheese, egg, garlic, salt, and pepper.
Spread a layer of marinara sauce on the bottom of a baking dish.
Layer roasted eggplant, cheese mixture, and marinara sauce, repeating until all ingredients are used.
Top with mozzarella and Parmesan cheese.
Bake for 45 minutes or until the cheese is bubbly and golden.