Application of XPS taken under ambient pressure conditions has become widespread in recent years. The distortion of the spectrum caused by scattering effects as the photoelectrons travel through the gas to the spectrometer causes a problem for interpretation of the spectra. In this paper we propose a method to correct for this. We use the QUASES software for which the cross section for inelastic electron scattering is an essential parameter. To determine this, we analyze a spectrum from a pure gold foil taken under 5 mbar N2 gas pressure and compare this to a spectrum of the gold foil taken under vacuum conditions and construct a cross section which accounts perfectly for the distortions caused by the gas. The procedure was then validated by first applying this same cross section to correct spectra taken under N2 gas pressures in the range 0.85 – 5.0 mbar. The effective thickness of the gas was the only adjustable parameter and the corrected spectrum was found to be in perfect agreement with the undistorted gold reference spectrum for all gas pressures. Next these determined effective thicknesses were found to be perfectly linearly dependent on the gas pressure. These two tests prove the validity of the method.