The rare earth electronic transitions, widely exploited for optical applications, occur within the shielded 4f shell and originate very sharp absorption (or emission) lines in spectra of crystals measured at low temperatures. High resolution absorption spectroscopy, covering broad spectral and temperature ranges, is a powerful tool not only to supply a complete and precise energy level scheme for the rare earth in optical materials, but also to disclose finer details on rare earth environment and interactions with i) other rare earths, ii) lattice vibrations, and iii) nuclear magnetic moments. In the present work the experimental results, taken in the temperature range 9-300 K, covered a spectral region as wide as 75-25000 cm-1 at a resolution as fine as 0.01 cm-1. Their interpretation is supported by calculations based mainly on crystal field theory, superposition model, and nuclear-electronic hyperfine interaction analysis. In this framework, a review is presented on the results obtained by our group during the last years in single crystals (BaY2F8 and YAl3(BO3)4 doped with a variety of rare earths for laser and self frequency doubling applications), in Er-doped glasses, and in nanostructured glass-ceramics for integrated optics.