A surfactant added to generate and stabilize foam, whether as a drilling fluid or in a foamed cement.