The optical system is very simple for such a useful device. Light enters the spectrometer from a clear slit in the transparency. The thin beam of light travels the length of the housing until it reaches a lens, which collimates the beam (or focuses it to infinity). The diffraction grating is located just after the lens, and you place your eye up close to the grating as you look through it. The grating disperses the different wavelengths of light, because the diffraction angle is a function of wavelength*. The resulting rainbow image appears to be located at optical infinity, superimposed on the scales. The markings on the scales are actually transparent too, so that rear illumination allows you to see them clearly. See figures below:
*For more information on diffraction, see: http://en.wikipedia.org/wiki/Diffraction_grating
Fun applet: http://www.physics.uq.edu.au/people/mcintyre/applets/grating/grating.html