The interfacial interaction between single-walled carbon nanotubes(SWNTs) and various gas molecules (H2, He, and N2) at different pressures has been probed by in situx-rayabsorption near-edge structure(XANES)spectroscopy. Experimental results reveal the different strength of interfacial interaction (involving external and internal collisions) between SWNTs and various gas molecules under different pressures. At gas pressures higher than 5 Torr, the unoccupied states of SWNTs show some features corresponding to the structure deformation with a reversible behavior when cycling under vacuum and gas conditions. The XANES study for different gases (H2, He, and N2) shows a strong dependence of gas molecular weight, which provides experimental evidence to the gas scattering mechanism.