Preheat oven to 350 degrees.
Cook spaghetti according to package directions.
Meanwhile, in a large skillet, cook beef and onion over medium heat until meat is no longer pink; drain. Stir in spaghetti sauce; set aside.
Mix together pasta, meat mixture, and cheddar cheese, pour into 9×13 pan.
Top with mozzarella cheese and bake for 30 minutes, or until cheese is bubbly.