Experiments on the spectroscopy of the Forster resonance Rb(37P)+Rb(37P) -> Rb(37S)+Rb(38S) and microwave transitions nP -> nS, nD between Rydberg states of cold Rb atoms in a magneto-optical trap have been performed. Under ordinary conditions, all spectra exhibited a 2-3 MHz line width independently of the interaction time of atoms with each other or with microwave radiation, although the ultimate resonance width should be defined by the inverse interaction time. Analysis of the experimental conditions has shown that the main source of the line broadening was the inhomogeneous electric field of cold photoions appeared at the excitation of initial Rydberg nP states by broadband pulsed laser radiation. Using an additional pulse of the electric field, which rapidly removed the photoions after the laser pulse, lead to a substantial narrowing of the microwave and Forster resonances. An analysis of various sources of the line broadening in cold Rydberg atoms has been conducted.