Dr. Barry Swanson, professor of food science and nutrition at Washington State University, says that, when you pour a beer, rapidly expanding carbonated bubbles rise to the top, grabbing proteins on the way. The proteins gather at the surface to form pockets of carbon dioxide, otherwise known as foam.
Beer foam sticks around (unlike, say, soda foam) due to the presence of carbohydrates, which stabilize it. Dark, thick beers have more carbohydrates. “That’s why a Guinness has a thick, creamy head, while a pint of Budweiser possesses a layer of thin, quickly dissipating foam.”
The introduction of oil reduces the surface tension of the bubbles, causing them to collapse and the foam to disappear. “You don’t need very much oil. You could spray the foam with nonstick Pam, or even add a drop of butter or olive oil—like you’d do to keep boiling pasta from sticking together—but that’s probably not a flavor you want,” Swanson says.
Stirring the foam with a nose-swiped index finger will get the job done, but it’s not the best idea. “You could be contaminating the beer with staph bacteria or who knows what else. The best removal method is to blow off the foam or run a knife across the top of the pint glass.”