Preheat oven to 400F (200C).
In a large saucepan, heat the oil over medium-high heat and cook onion and garlic until soft, about 5 minutes.
Stir in rice until coated, then pasta sauce (or tomatoes), and cook another 5 minutes. Add broth (and seasoning, if using plain tomatoes), and bring to a boil, stirring often.
Transfer to oven-safe dish if necessary, and cover tightly. Bake in centre of oven until all liquid is absorbed, about 30 minutes.
Remove from oven and stir in spinach. Garnish with pine nuts.