Preheat oven to 425 degrees. Heat oil in a large saucepan over medium heat. Add onion garlic, and mushrooms, and season with salt and pepper; saute.. Add thyme and tomatoes. Bring tomato sauce (marinara) to boil, and set aside.
Meanwhile, cook ravioli in a large pot of boiling salted water just until they float to the top (pasta will continue to cook in oven). Drain pasta; return to pot.
Toss sauce with pasta. Pour pasta into a large gratin dish or smaller individual baking dishes, and layer with cheese. Bake until golden, 20 to 25 minutes. Cool slightly before serving.