Aroma also plays a huge role in our perception of flavor, maybe even more than the taste itself (as anyone who has ever had a head-cold can attest). Beer brewers put a great deal of work into the aromatic components of their beer, and giving their beer a nice head of foam ensures that the beer drinker will get to appreciate those aromas.
Foam affects the way the beer feels in our mouths, as well. The density of the head gives the beer a creamy quality and a sense of fullness on the tongue. You'll notice this in particular with hefeweizens, farmhouse ales, and other wheat beers. Beers brewed with oats and rye also tend produce excellent heads of foam.
The quality of the foam in any given glass of beer is the result of many of factors: how the beer was brewed, the ingredients used, the level of carbonation, the serving glass, and even how the beer was poured. Foam dissipates quickly if there are any residual oils in the glass or even on your lips (nix the chapstick!). Pouring the beer down the side of the glass rather than straight down the middle will also result in a less than perfect head.
The amount and quality of foam can also depend on the style of beer. As mentioned, those hefeweizens traditionally sport some of the more impressive heads of foam. On the other hand, high-alcohol beers like barley wines and imperial stouts have much less since alcohol inhibits foam formation. The majority of ales and lagers fall somewhere in the middle of these two extremes.
Bottom line: embrace the beer foam. Its presence is very often a sign of good things to come.
(Images: Emma Christensen)