We consider the effect of radiation pressure from ionizing photons on black hole (BH) mass estimates based on the application of the virial theorem to broad emission lines in AGN spectra. BH masses based only on the virial product V^2R and neglecting the effect of radiation pressure can be severely underestimated especially in objects close to the Eddington limit. We provide an empirical calibration of the correction for radiation pressure and we show that it is consistent with a simple physical model in which BLR clouds are optically thick to ionizing radiation and have average column densities of NH~10^23 cm^-2. This value is remarkably similar to what is required in standard BLR photoionization models to explain observed spectra. With the inclusion of radiation pressure the discrepancy between virial BH masses based on single epoch spectra and on reverberation mapping data drops from 0.4 to 0.2 dex rms. The use of single epoch observations as surrogates of reverberation mapping campaigns can thus provide more accurate BH masses than previously thought. Finally, we show that Narrow Line Seyfert 1 (NLS1) galaxies have apparently low BH masses because they are radiating close to their Eddington limit. After the radiation pressure correction, NLS1 galaxies have BH masses similar to other broad line AGNs and follow the same MBH-sigma/L relations as other active and normal galaxies. Radiation forces arising from ionizing photon momentum deposition constitute an important physical effect which must be taken into account when computing virial BH masses.