Carbonate rocks are typically heterogeneous at many scales, leading to low waterflood recoveries. Polymers and gels cannot be injected into nonfractured low-permeability carbonates (k < 10 md) because pore throats are smaller than the polymers. Foams have the potential to improve both oil-displacement efficiency and sweep efficiency in such carbonate rocks. However, foams have to overcome two adverse conditions in carbonates: oil-wettability and low permeability. This study evaluates several cationic-foam formulations that combine wettability alteration and foaming in low-permeability oil-wet carbonate cores. Contact-angle experiments were performed on initially oil-wet media to evaluate the wettability-altering capabilities of the surfactant formulations. Static foam-stability tests were conducted to evaluate their foaming performance in bulk; foam-flow experiments (without crude oil) were performed in porous media to estimate the foam strength. Finally, oil-displacement experiments were performed with a crude oil after a secondary gasflood. Two different injection strategies were studied in this work: surfactant slug followed by gas injection and coinjection of surfactant with gas at a constant foam quality. Systematic study of oil-displacement experiments in porous media showed the importance of wettability alteration in increasing tertiary oil recovery for oil-wet media. Several blends of cationic, nonionic, and zwitterionic surfactants were used in the experiments. In-house-developed Gemini cationic surfactant GC 580 was able to alter the wettability from oil-wet to water-wet and also formed strong bulk foam. Static foam tests showed an increase in bulk foam stability with the addition of zwitterionic surfactants to GC 580. Oil-displacement experiments in oil-wet carbonate cores revealed that tertiary oil recovery with injection of a wettability-altering surfactant and foam can recover a significant amount of oil [approximately 25 to 52% original oil in place (OOIP)] over the secondary gasflood. The foam rheology in the presence of oil suggested propagation of only weak foam in oil-wet low-permeability carbonate cores.