The stability of foam in the presence of oil is of fundamental interest in enhanced oil recovery processes using foam for mobility control. Experimentally, it is known that lauryl betaine (LB) increases foam stability of certain anionic surfactants, and LB is referred to as a foam booster. However, the molecular basis for this effect is not well understood. Using molecular dynamics simulations, here we study a system of LB and alpha olefin sulfonate (AOS-14), an anionic surfactant that is used as a foam stabilizer. We monitor the area per molecule, a quantity that correlates with the surface shear viscosity, and the surface dilatational modulus to infer the stability of the various mixtures. We find that the influence of LB is nonmonotonic: the area per molecule and surface dilatational modulus have a minimum and maximum, respectively, around 30% LB in the monolayer. We show that this net effect has its basis in two competing effects: the favorable interaction between LB and AOS-14 that tends to shrink th...