Rotational and vibrational excitations of molecules in Na+-N2 and Na+-CO collisions were studied at centre-of-mass energies of 27<or=E<or=192 eV. The energy of the scattered particles was analysed by a time-of-flight technique. The energy-loss spectra of the ions scattered in Na+-N2 collisions contain two peaks, while those for Na+-CO contain three peaks. The structures in the spectra can be well explained by rainbow effects arising from rotational and vibrational excitation.