In a medium stovetop-to-oven pot melt butter or olive oil over medium heat. Add chopped onions and cook 3 to 5 minutes, stirring until softened. Add rice and stir until well coated.
Add chicken or vegetable stock, salt and pepper to taste. Bring to a boil.
Cover and bake until the rice is tender and the stock is absorbed, about 20 to 25 minutes.