In a sauté pan over medium heat, cook the sausage, onion, and mushrooms (if using), and garlic, stirring often, until the sausage is cooked through. Add the marinara sauce and mix well. Stir in the drained pasta, and add half the mozzarella and parmesan cheeses, Mix well, then spread onto the prepared pan. Dollop the ricotta over the top of the pasta mixture, spacing evenly. Sprinkle the remaining mozzarella over all, then repeat with the remaining parmesan. Bake in the oven about 15-20 minutes until bubbly and browned. Broil if you want to brown the cheese a bit more. Let cool about 10 minutes before serving with a basil garnish.