Spectral analysis of laser radiation emitted by diatomic molecules and simple theoretical models have allowed us to study population-inversion mechanisms in the u.v. and i.r. for N2 and visible CO molecular lasers. The technique is readily applicable to other diatomic molecules. Observations of Λ -doubling in N2 u.v. laser emission and analysis of rotational structure in i.r. laser emission for the same molecule are used to determine the main features of electronic excitation and different channels for population of the laser levels involved. For the visible molecular CO laser, a fit of the rotational intensity distribution of the emitted visible bands was used to determine enhancement mechanisms by which population inversion is achieved in some Q-branch transitions.