Peel onions, and remove ends. Cut each onion into quarters. Place 2 quarters of onion in a 6 inch square piece of tin foil, inserting a slice of butter or margarine between the pieces. Season with salt and pepper to taste. Close foil around onion. Repeat with remaining onions.
Set foil packets on lower rack of a gas grill, or directly on top of hot coals. Cook for about 30 to 35 minutes.