Pumice forms when volcanic gases exsolving from viscous magma form bubbles that remain within the viscous magma as it cools to glass.