Preheat oven to 375 degrees F (190 degrees C). Oil an 11x7x2 inch baking dish.
Arrange a single layer of polenta in the bottom of the prepared baking dish. Spread a thin layer of pesto over the polenta. Spoon half of the sauce over the polenta. Top with another layer of polenta and sauce.
Bake, uncovered, for 25 minutes. Turn on the broiler. Top polenta with cheese and pine nuts, and broil until cheese browns and nuts are toasted.