This week's question raises the issue of head. Why do some beers foam more than others?
We can break the beer's foaminess into three components: head formation, head retention and head stability.
The foam is formed, essentially, by carbonation, either natural or forced. Brewers can cause beer to be carbonated in two ways. The first, and oldest, way of carbonating beer is called "natural" carbonation; it is also called bottle-conditioning. The second method is called "forced" carbonation. Natural carbonation (aka bottle conditioning) is performed by adding a small amount of active yeast to the closed container (a bottle, barrel, keg, etc.). Adding yeast causes a small amount of further fermentation. One of the byproducts of fermentation is CO2. In the course of the beer-production process, this CO2 usually escapes. However, because the bottle is closed, there is nowhere for the CO2 to go. It can either go into the headspace (the space in the bottle between the cap and the liquid), or it can be dissolved into the liquid. Since there is not much headspace in any given bottle, most of the beer is dissolved into the liquid itself. When the beer is opened and poured, the CO2 escapes the beer in the form of bubbles.
And that, essentially, is the start of your head. The bubbles of CO2 rise through the glass and escape through the top of your glass. Thus, the amount of bubbles that exist are a function of how highly carbonated the beer is. But that's not the end; if it ended here you would essentially have some fizzing but no accumulated head, much like carbonated water. For that, you need head retention.
The basic principle of head retention is that the CO2 bubbles bind to substances in the beer that form a skin around the bubble. The CO2 then escapes into the air leaving the skin at the top of the beer. Malts that are high in protein (also wheat and unmalted barley) lend comparatively more binding power for the bubbles, thus provide more head. Also, isohumulones found in hops and used for bittering contribute to formation of a nice frothy head on the top of your beer. Fats, like those found in oats and coffee and chocolate, however, destroy foam. Of note, detergents also destroy foam, so make sure you thoroughly rinse your glassware to eliminate residual soaps.
The viscosity of the beer, to some extent, determines how well the head sticks around. The slower the beer pours, the thicker or more body the beer has, the harder it is for the head to fall away. For example, raw and flaked barley (also, dextrin malts) in the malt bill add body without adding fats like oats would. Some beers, particularly Irish beers like Guinness, Beamish, and Smithwicks, use a mix of nitrogen with the CO2 in carbonating their beers (as a side note: this is part of what that widget in your bottle of Guinness does). The nitrogen creates smaller bubbles and a more stable head. Many people will also tell you that bottle conditioning causes the smaller bubbles, thus a more stable head. And the sticky iso-alpha-acids in hops can help cause the foam to cling to the side of the glass.
Hopefully, this went at least a little way towards answering how head is formed. For more information, check out these awesome sites: www.byo.com, BrewWiki. And, to learn how to pour your beer correctly to form that perfect head, check out Beer Advocate's instructions.