Bring a large pot of salted water to a boil over high heat. Add in the spaghetti and cook until it is pliable but still firm to the bite, about 8 minutes. Drain well and set aside.
In the meantime, heat a large pan over medium heat. Crumble in the Italian sausage and stir occasionally until browned, about 4 to 5 minutes.
Add onion, garlic, salt, and pepper. Cook until the onion is translucent and slightly softened, about 2 minutes.
Pour in the marinara sauce and stir to combine. Remove from heat and set aside.
In a large bowl, whisk together the ricotta and egg until combined. Set aside.
Pour half of the marinara sauce into a deep 9x13 inch casserole dish, and then layer on half of the pasta.
On top of the pasta, spread all of the ricotta cheese mixture into an even layer.
Add the remaining pasta, pour on the remaining marinara sauce, and top with mozzarella and parmesan.
Cover with foil and bake for 30 minutes. Remove foil and bake for another 5 to 10 minutes, or until the cheese is melted and sides are bubbling.
Remove from oven. Garnish with chopped parsley and/or additional parmesan cheese.