Cook the ziti pasta according to package directions. Drain and set aside.
Heat about a tablespoon of olive oil in a large skillet over medium-heat heat. Add the Italian sausage and cook while breaking up into chunks with a spatula. Add onions and stir to combine. Cook for about 4-5 minutes or until the sausage is browned and the onions are beginning to brown. Add garlic, basil, and red pepper flakes. Add marinara sauce and mix well. Season with salt and pepper to taste.
Preheat the oven to 350 degrees Spread a layer of the sauce onto the bottom of a greased 9x13 inch baking dish, then dot the surface with half of the ricotta cheese. Add a spoonful of the sauce into the pasta and mix well. Add the pasta to the casserole. Pour the remaining sauce over the pasta, dot with the remaining ricotta and sprinkle mozzarella and parmesan cheese on top.
Bake at 350 degrees for 20 to 25 minutes or until the top the lightly browned and the cheese has melted.