The high-power density of a frequency quadrupled pulsed Nd-YAG laser has been used to photodetach electrons from negative ions in rf plasmas generated within a microwave cavity. Negative ion densities have been determined by measuring the frequency shift of the resonance transmission, the shift being caused by the photoelectrons created by irradiating the plasma with the laser pulse. By measurement of the shape of the resonance curve as a function of time and of microwave frequency, and consecutive fitting of a parabola to the top of the resonance curve, the negative ion density has been determined as a function of gas pressure, rf power, and position in the plasma. Measurements were performed in plasmas of CF4, C2F6, CHF 3, and C3F8. The results indicate that the negative ion densities are about one order of magnitude larger than the electron density, which is in good agreement with a fluid model calculation. The pressure and power dependence of the electron density and of the negative ion density gives insight in the relation between the electron temperature and the macroscopic plasma parameters. Measurements as a function of the laser wavelength, using a pulsed dye laser, show that in CF4 the negative ions mainly consist of F-, whereas in C2F6 significant densities of other negative ions may occur.