Hydrogen peroxide (H202) foams because the human blood and every cell contain the enzyme catalase. Since every cut or injury contains damaged cells and blood, a large number of catalase are floating around the open wounds. When hydrogen peroxide is applied to the injury, the catalase converts the (H202) into (H2O) water and releases (O2) oxygen gas.
The enzyme catalase performs this task very flawlessly – there are more than 200, 000 of such enzyme-driven reactions occurring every second. The white bubbles that appear on the site of the wound are pure bubbles of oxygen produced by the enzyme, catalase. A drop of hydrogen peroxide on a sliced potato produces the same results, and the reason is not different from that which is responsible for the observation during the reaction with blood.
Hydrogen peroxide will not foam on your body without an open wound or in the container. Catalase must be present for the reaction to take place. At room temperature, hydrogen peroxide remains stable.
Reference:
http://chemistry.about.com/od/medicalhealth/f/Why-Does-Hydrogen-Peroxide-Bubble-On-A-Wound.htm