Preheat the oven to 400 degrees. Grease a 13×9 dish.
Cook the spaghetti for 2 minutes less than the pkg directions say to cook it. Drain the spaghetti well and transfer it to a bowl. Stir in the ricotta, pesto, 1 cup of the mozzarella, 1/2 cu. of the Parmesan and the goat cheese.
Toss the mixture well and transfer it to the baking dish.
Sprinkle it with the remaining mozzarella and Parmesan.
Bake until the cheese is melted, about 15-20 minutes. Turn the oven to broil and broil for 1 minute or until golden (we skipped the broil setting.)