RHESSI observes solar photons over three orders of magnitude in energy (3 keV to 17 MeV) with a single instrument: a set of nine cryogenically cooled coaxial germanium detectors. With their extremely high energy resolution, RHESSI can resolve the line shape of every known solar gamma-ray line except the neutron capture line at 2.223 MeV. High resolution also allows clean separation of thermal and non-thermal hard X-rays and the accurate measurement of even extremely steep power-law spectra. Detector segmentation, fast signal processing, and two sets of movable attenuators allow RHESSI to make high-quality spectra and images of flares across seven orders of magnitude in intensity. Here we describe the configuration and operation of the RHESSI spectrometer, show early results on in-flight performance, and discuss the principles of spectroscopic data analysis used by the RHESSI software.