Optical emissions from long-lived, excited states of CO+ and N2+ in ion beams have been studied. CO or N2 is ionized by electron impact, and the ions are removed from the ion source to the observation region. Spectra of emission from CO+ and N2+ are obtained for wavelengths in the ranges 3200–5200 Å and 6000–8700 Å, respectively. All of the spectral features can be ascribed to the CO+ comet-tail and N2+ Meinel emission systems. The electronic transition moments, R̄e, for these two emission systems are determined and are found to vary rather slowly with wavelength over the wavelength ranges for which we have data. Lifetimes of the v′=1, 2, 4, and 6 vibrational levels of CO+ (A 2π) are found to be 3.49, 2.78, 2.63, and 2.41 μsec, respectively. Lifetimes of the v′=2, 3, 4, and 5 vibrational levels of N2+(Aπu2) are found to be 12.28, 10.70, 10.08, and 9.14 μsec, respectively. The dependences of the measured lifetimes on v′ are consistent with the experimental values of Re and with available Franck-Condon factors. Relative cross sections for excitation of various emission bands have been derived from the spectra and lifetimes presented in this report; these cross sections agree fairly well with theory and with previous measurements. The A states of CO+ and N2+ appear to constitute about 46% and 30%, respectively, of the ions produced by 46.5-eV electrons impinging on CO and N2. The electron energy dependences of the light output in the (2, 0) Meinel band and in the (3, 0) and (4, 0) comet-tail bands have been measured from threshold to 200 eV. From our data and total ionization cross sections we obtain maximum cross sections for excitation of the (2, 0) Meinel and the (3, 0) comet-tail bands of 0.073 and 0.133 Å2, respectively.