Cooking pasta: why does adding a lid lead to overflow? When cooking pasta, some organic foam usually forms on the surface of the boiling water and the situation can be kept under control by adjusting the heat (and/or adding some oil).
Covering the pot with a lid, even loosely so, usually leads to the foam overflowing within a short time (removing the lid fixes the problem). Everybody knows that - the question is why?
It seems to me that the only variable that changes noticeably when adding the lid is the vapor pressure but I don't see how that should affect the foaming process.
 A: The interior of the bubbles is mostly steam. When you raise the lid, cold (well, below $100^\circ\text{C}$) air flows in and the steam in the bubbles condenses and collapses the bubbles.
I don't know of anyone who has done the experiment, but you should find if you lift the lid when the outside temperature is $100^\circ\text{C}$ or greater, the foam will not collapse, or at least it will collapse more slowly. Presumably you'd still get evaporation from the foam surface.
Edit: just out of curiosity I worked out how much air would have to enter the pan to condense the steam in the foam.
Density of steam at atmospheric pressure $\rho_s = 5.90\times10^{-4}\text{ g}/\text{cm}^3.$
Latent heat of steam at atmospheric pressure $= 2.26\text{ kJ}/\text g \implies 0.00133\text{ kJ}/\text{cm}^3$
Suppose your pan contains $100\text{ cm}^3$ of steam in the foam then the heat given off when you condense it to water at $100^\circ\text{C}$ is $0.133\text{ kJ}$.
The specific heat of air is about $1\text{ J}/(\text{g}\cdot\text{K})$ so assuming the air in your kitchen is about $20^\circ \text C$, i.e. a temperature change of $80^\circ\text C$ when it hits the steam, you need $1.66\text{ g}$ of air. The density of air is about 1.2 g/litre so you need about 1.4 litres of air to fully condense the steam. I must admit that this seems a lot.
However you probably don't have to condense all the steam to collapse the foam. I suspect (but can't prove) that condensing the steam just inside the bubble wall would be enough to destabilise it and cause the bubble to break. The remainder of the steam in the bubble would simply escape and wouldn't need to be condensed, so the volume of air needed would be greatly reduced. Still, I have to concede that evaporation could well be an important factor.
A: When we cover the lid and heat the water, there is a increase of pressure inside the container. 
The pressure inside the container is greater than atmospheric  pressure.
When we open the lead there is abrupt change in pressure.
This sudden Change of pressure cause the vapour to expand suddenly in the bubbles which is greater than the Surface tension of the bubbles.
That is why the bubbles get bursted as soon as the lid get opened.
I don't think the temperature play any role in formation and deformation of bubbles, as bubbles can form at any temperature.
$Pressure$ is playing a vital role in this !!!!
