Adapted from Oh My Veggies
Preheat oven to 350° and spray a 9 x 13 baking dish with cooking spray.
Heat olive oil in a large skillet over medium heat. Add onion and cook until softened, about 4 minutes. Add zucchini and mushrooms and cook until softened and liquid has boiled off, about 7 minutes more. Remove from heat.
Add pasta, marinara sauce, ricotta, salt, and pepper to skillet with vegetables. Stir until well combined.
Pour pasta mixture into baking dish. Top with cheese. Bake for 30 minutes.