Both spontaneous and stimulated emission processes are essential ingredients for constructing a laser from the nitrides. Based on our picosecond time-resolved photoluminescence studies we show that spontaneous radiative recombination is strongly influenced by excitonic effects, both in bulk GaN and in quantum wells. Particularly in quantum wells, localization of excitons plays an important role. We have studied the optical gain spectra in GaInN/GaN and GaN/AlGaN double heterostructures and quantum wells, grown by LP-MOVPE, using the stripe excitation method. Both room temperature and low temperature measurements were performed. Based on our results, we discuss the physical mechanism of optical gain in the nitrides as well as consequences for laser operation. We show that localization or, equivalently, the formation of quantum dot like structures, governs the optical gain mechanism in the nitrides.