On the spectra of the rare earth elements