Preheat oven to 350 degrees F.
Cook pasta according to directions. Drain and set aside.
Meanwhile, cook sausage with garlic, onion, salt, pepper and red pepper flakes in a big skillet, break up into small chunks. Cook until browned, 6-7 minutes. Remove from heat and drain grease, if necessary.
In the skillet, add the ricotta, basil and about 1/2 of the spaghetti sauce. Mix it together. Add in the pasta. Mix together. (If your pan isn't big enough, you can use a big bowl.
Put about 1/2 of what's left of the spaghetti sauce on the bottom of a 9x13 baking dish. Add pasta. Spoon the remaining spaghetti sauce over it. Top with mozzarella.
Bake about 30 minutes or so until the cheese is melted and golden brown.