Preheat the oven: Set it to 375°F (190°C). Lightly grease a 9x13-inch baking dish with olive oil.
Season the sauce: In a bowl, combine the marinara with Italian seasoning, garlic, red pepper flakes (if using), and a pinch of salt and pepper. Stir to blend.
Add a base layer: Spread about 1 cup of sauce over the bottom of the baking dish.
This keeps the ravioli from sticking and helps them cook evenly.
First layer of ravioli: Arrange half of the ravioli in a single layer over the sauce. It’s okay if they overlap slightly.
Ricotta dollops: Spoon half the ricotta in small dollops over the ravioli. Don’t worry about spreading perfectly—little pockets of creaminess are the goal.
Add cheese and sauce: Sprinkle 1 cup of mozzarella and a couple tablespoons of Parmesan over the ricotta.
Pour about 1 to 1 1/2 cups of sauce over the top.
Repeat layers: Add the remaining ravioli, then the rest of the ricotta, another cup of mozzarella, more Parmesan, and enough sauce to cover. You want the pasta mostly submerged so it cooks through.
Cover and bake: Cover tightly with foil and bake for 25–30 minutes (fresh ravioli) or 35–40 minutes (frozen). You’re looking for bubbling sauce around the edges.
Uncover and finish: Remove the foil, sprinkle any remaining mozzarella and Parmesan on top, and bake uncovered for 8–12 minutes until the cheese is melted and lightly golden.
Rest and garnish: Let the casserole rest for 5–10 minutes to set.
Top with chopped basil or parsley and a crack of black pepper. Serve warm with extra sauce on the side if you like.