Preheat oven: Set oven to 375°F and lightly grease a 9x13-inch baking dish with butter or cooking spray.
Cook the ravioli: Bring a large pot of salted water to a boil, add the frozen ravioli, and cook for 4-5 minutes or until they just begin to float (they'll finish cooking in the oven, so avoid overcooking them now).
Drain and combine: Drain the ravioli in a colander without rinsing, then gently transfer them to the prepared baking dish.
Add the sauce: Pour the entire jar of pasta sauce over the ravioli and stir gently to coat, being careful not to break the ravioli.
Layer the cheese: Sprinkle the shredded mozzarella evenly over the top, and if using parmesan, scatter that over as well.
Bake covered: Place the baking dish in the preheated oven, covered with aluminum foil to prevent excessive browning, and bake for 20 minutes.
Uncover and finish: Remove the foil and bake for an additional 10-12 minutes until the cheese is melted, bubbly, and lightly golden on top.
Rest and serve: Let the casserole rest for 5 minutes before serving, which allows the sauce to set slightly and makes serving much easier.