Preheat the oven to 400°F. Brush each ear of corn all over with ¼ teaspoon oil or melted butter (1 teaspoon total for 4 ears).
Wrap each ear individually in a piece of aluminum foil, using just enough foil to enclose each tightly.
Arrange the wrapped ears in a single layer directly on the middle oven rack. Cook for 20–25 minutes, until the kernels are steaming hot and just tender.
Carefully unwrap and serve with butter and flaky salt, or your favorite toppings.
Video
Notes
This method works for any number of ears. Simply use ¼ teaspoon olive oil or melted butter per ear of corn.
Cook 20 minutes for crisp-tender kernels, 25 minutes for medium tenderness, or up to 30 minutes for very tender kernels.