I googled "spectroscopy" and got
http://en.wikipedia.org/wiki/Spectroscopy.
It seems like a pretty good article, although it lumps together the cosmological redshift and the Doppler shift
(one is due to stretching during travel, the other is due to source motion, but the shift in wavelength is measured the same way)
basically the tool is a PRISM or something analogous to a prism called a diffraction grating which you could think of as a lot of parallel scratches on a thin flat glass plate that act like a lot of thin parallel prisms.
the diffraction grating (like a prism) spreads the light out into its different wavelengths
so you get a band that looks like a cross-section of a RAINBOW
a rectangle with lots of different color-stripes-----it is called a "spectrum"
the color stripes are called "spectral lines"
this band of color-stripes is made to fall on photographic film, or on a modern solidstate CCD electronic substitute for film----so they take a picture of the spectrum
and they LOOK WHERE THE LINES ARE
it is like a fingerprint of the star
what lines, tells what atoms are in the star----like if it is an recycle-material star with some sodium or iron in
or if it is a fresh-material star with mostly pure hydrogen and helium
all these things have distinctive lines
and they measure carefully if the lines have been SHIFTED to a slightly different wavelength.
spectroscopy is done very accurately in Earth laboratories and they know these wavelengths very accurately, using light from flames and electric discharge etc.
so all the astronomers need to do is stick a telescope into the picture (between the "flame" and the "prism")
it is one of the cooler things humanity is done----a way of smelling what is cooking on the surface of stars