Preheat oven to 325°.
Place sweet potatoes in a shallow roasting pan coated with cooking spray. Drizzle with oil. Sprinkle with salt and pepper; toss to coat. Bake at 325° for 30 minutes. Add onion; stir well. Bake an additional 30 minutes; remove from oven.
Drizzle sweet potato mixture with butter; stir to coat. Broil 10 minutes or until browned.