A foam is a substance formed by trapping pockets of gas in a liquid or solid. A bath sponge and the head on a glass of beer are examples of foams. In most foams, the volume of gas is large, with thin films of liquid or solid separating the regions of gas.Solid foams can be closed-cell or open-cell. In closed-cell foam, the gas forms discrete pockets, each completely surrounded by the solid material. In open-cell foam, gas pockets connect to each other. A bath sponge is an example of an open-cell foam: water easily flows through the entire structure, displacing the air. A camping mat is an example of a closed-cell foam: gas pockets are sealed from each other so the mat cannot soak up water.