Who doesn't like a good beer? Geologists/geophysicists are always appreciate a nice cold glass of their favorite beverage poured by a skilled bartender that produces a nice frothy head that persists for the entire experience. The question is why does the head not disappear quickly like soap bubbles? Douglas Durian and Srinivasa Raghavan wrote up a 'quick study' in the May 2010 issue of Physics Today. This article is based on that article with some additional information. Durian and Raghavan also discuss soap bubbles and present high magnification photos of foam structures, but those will be ignored here as their method of persistence is quite different than that of beer foam.
When beer is produced proteins are present in the mix. If you enjoy the cloudy wheat beers you are seeing proteins precipitate out! Actually something called the isoelectric point determines what happens to the proteins. If the pH of the beer is too close to the IEP the proteins precipitate out. The further the pH gets from the IEP the more soluble the proteins are. Why does it matter?
Remember from high school biology that proteins have hydrophilic and hydrophobic parts to them. This means that one part of the protein 'likes' water and will immerse itself, but the other end does not like water and tries to stay away from it. When we look at a foam magnified there are small fluid sections in-between the air bubbles. Proteins orient themselves in the bubble walls. Say that a bubble begins to stretch thin and is in danger of bursting. The stretching of the wall means there are fewer proteins in the middle where the wall is thin and more on the edges. Proteins can change the surface tension and this gradient is surface tension causes liquid to flow to the thin section, restoring the stability of the bubble. This effect is known as the Gibbs-Marangoni effect, and is in fact a strong example of the phenomena.
This Gibbs-Marangoni effect was in fact first observed in glasses of wine (pictured) and discussed by Lord Kelvin's brother James back in the mid 1800's. Carlo Marangoni studied the idea for this dissertation and the solutions of the problem were formalized by Williard Gibbs. (Yep, that the same guy that independently developed vector analysis, Gibbs free energy, etc)
So is there anything other than pH that can change the persistence of head? Absolutely! Due to gravity the fluid drains to the bottom over time which destabilizes the foam. There isn't much to do about that, but we can combat Ostwald ripening. Basically this mean that gas diffuses from smaller bubbles to larger ones. Laplace described this knowing that the large bubbles have a smaller curvature and therefore lower pressure than small bubbles. According to the article brewers can add about 20ppm of nitrogen to the beer to slow this process.
The items discussed in this article apply across many scientific items. There is an everyday example that scientists would call Benard-Marangoni convection, but you probably call it boiling water.