Remove husks and silk from corn. Combine margarine, salt, and pepper in a small bowl, stirring well. Brush margarine mixture over corn. Place each ear on a piece of heavy-duty aluminum foil. Place 3 basil leaves under each ear of corn and 3 leaves over each ear. Roll foil lengthwise around each ear; twist at ends to seal.
Place foil-wrapped corn on a baking sheet. Bake at 450° for 15 minutes or until tender.