Energy, time, and spectral characteristics of emission of the second positive system of N2 molecules in gaseous nitrogen, Ar — N2 mixture, and air are investigated. An FPG-10 generator with voltage pulse FWHM of 200 and 400 ps and matched-load amplitudes of 14 and 6 kV, respectively, is used to excite gases. It is shown that excitation can be performed in two regimes using this generator. In the first regime a diffuse discharge is formed at atmospheric pressure, which opens ways to design miniature nanosecond UV lamps. A diffuse discharge is formed due to the generation of runaway electrons, with the aid of electrodes having a small radius of curvature and voltage pulses with a sharp leading edge. In the second regime an elevated average radiation power is obtained under excitation by a barrier discharge. However, the operating pressure is lower in this case, and the sizes of the emitting region and the UV pulse width significantly increase.