Hot tub foam has many possible sources, including soap residue, deodorant, body lotion and dead skin. These substances dissolve into the water and increase over time. The accumulation eventually attaches to air bubbles and comes up to the surface as foam.
The spa industry refers to the accumulation as "TDS" or "Total Dissolved Solids." People can reduce the amount of foam by showering before entering the tub. Properly cleaning the filters and using the correct chemicals can also help to prevent foam. Once a hot tub becomes saturated with foam, the only remedy is to drain and replace the water.