Foam is made when pockets of gas form inside a liquid substance. There are several different types of foam, from the foam that forms on a glass of soda to the polyurethane foam used to manufacture furniture upholstery.
Polyurethane foam, such as the foam used to make memory foam products, is created by mixing water with either halocarbons or hydrocarbons. Alternative forms of flexible foam used for furniture and other applications are made with water, isocyanate and polyol.
Insulation foam is made in a similar way using polyols and methylene diphenyl diisocyanate. This type of foam is sprayed in liquid form, but it subsequently hardens to create insulation between walls and other fixtures.