Beer is a delicious glass of chemistry and biology, and the bubbles can be natural or artificial. For the most part, the bubble forming gas is carbon dioxide, which causes bigger bubbles and a 'fizzier' beer. CO2 can be artificially introduced by dissolving it under pressure, or it can be naturally formed as a byproduct of fermentation by the yeast.
Some beers, like the Guinness family of brews, use nitrogen or a CO2-nitrogen mix either as a widget in the pacakged product or to draw the liquid from a keg. These bubbles are smaller and result in a denser head, less effervescent beer and the distinctive 'creamy' texture. Even without foam, the gas involved influences a beer's flavour. Dissolved carbon dioxide forms the weak carbonic acid, affecting the acidity of beer and therefore its taste.
Obviously the bubbles at the top of the beer aren't just gas - there's something holding them together. Lasting bubble formation requires a surfactant, a molecule with both hydrophilic and hydrophobic parts, like the lipids in soap. Ironically, even trace amounts of soap residue in your beer glass can kill the head. As the gas bubbles in your beer rise, they pick up a number of molecules. One of the more important molecules is lipid transfer protein-1 (LTP1) (pictured). This protein is present in barley, but is not surface active until denatured by the boiling of the unfermented liquid (or wort). This protein is so important for foam stability - and foam stability is so important for the beer drinking experience - that German scientists (and who knows beer better than the Germans? The Czechs and the Irish, that's who) have engineered yeast expressing LTP1 to improve the foaminess of your draught. Potential brewmasters should also know that the temperature and duration of boiling your wort affects the extent and degree of LTP1 denaturation, and therefore the quality of your head. But LTP1 isn't the only molecule involved in a frothy mug, and not the only one subject to engineering. Japanese researchers have discovered that another barley protein, lipoxygenase-1 (LOX), has the opposite effect, reducing foam and flavour stability. LOX-less barley has been developed and tested for brewing by Sapporo.
So why go to all the trouble to increase the amount and stability of beer head - something many drinkers go out of their way to avoid? For one thing, a foamy pour reduces carbonation. This has two effects: First - and this is important to any drinker and the bartenders they're tipping - it means you can drink more. On average, a pint of beer contains 2.5 pints of carbon dioxide. A still pour keeps the CO2 dissolved in the beverage, where it ends up in your stomach, contributing to a bloated feeling. Secondly, less dissolved CO2 means a less acidic flavour. A bubbly pour releases the gas, affecting the taste. Acidity is also associated with a less thirst-quenching beer. Yes, research has been done into what factors determine how refreshing that beer is on a hot summer day. Strangely, while acidity - which can be caused by carbonation - along with foam and flavourfulness, negatively affect thirst-quenching properties, bubble density and carbonation have a positive correlation. Which is why your refreshing summer beer tends to be a fizzy, flavourless drink.
As the bubbles rise in your glass, they pick up more than just LTP1. Alpha-acids from the hops are also accumulated, and create a longer lasting foam. More importantly, these are also flavour compounds. Like wine - or just about anything - flavour is as much a play in the nose as on the palate. And while you won't find many beer drinkers discussing 'bouquet', it's there and it's important. The white cap in your glass concentrates these scents and flavours, enhancing the drinking experience.
Next time one of your friends gives you a foamless beer, ask them to pour it right. Not only is it visually appealing (and a clue that the beer you're drinking isn't flat) but it results in a more drinkable pint that engages your tactile, olfactory and gustatory senses. There's a lot of science in there too.