The invention is a foam method for improving conformance during a steam flood or carbon dioxide flood in a subterranean, oil-containing formation penetrated by at least one injection well and at least one production well. In a steam flood oil recovery process, sweep efficiency is improved by injecting steam until steam breakthrough occurs at the production well after which a mixture of steam, a noncondensible gas, and an aqueous surfactant-polypeptide solution is injected into the formation. The aqueous surfactant-polypeptide solution forms a stable foam with the formation oil at formation conditions that reduce the permeability of the highly permeable steam swept zones thereby diverting the steam to other portions of the formation containing unswept oil. The polypeptide is used as a partial substitute for the surfactant to improve the cost of the foam-forming mixture without reducing its effectiveness in increasing sweep efficiency. In another embodiment of the invention, the mixture of steam, surfactant-polypeptide solution and noncondensible gas may be injected into the formation surrounding a production well that has previously experienced severe steam breakthrough to significantly decrease the permeability of steam-swept zone surrounding the production well.