|Once upon a time, in the German town of Bavaria, a 14-year-old boy named Joseph Fraunhofer (http://en.wikipedia.org/wiki/Joseph_von_Fraunhofer) was working as an apprentice glassmaker. It was 1801. He had been orphaned 3 years before, and expected to spend his life working very hard making spectacles. Suddenly the roof of his workshop collapsed, burying him in the rubble.|
The local Prince Elector, who later became Maximilian I of Bavaria, led the rescue effort and was delighted to find the boy alive. He gave young Joseph some books and money and ordered his harsh employer, Philipp Anton Weichelsberger, to give him time off work to study.
Some 13 years later, after much study and during a very successful glassmaking and lens crafting career, Fraunhofer decided to study light in more detail. Hans Lippershey had invented the telescope two hundred years previously, and Galileo had made it famous. But telescopes had a problem. When you shine light through a prism, it splits into rainbow colours, and that is what was happening in magnifying lenses too. Isaac Newton had tried to find out a way to get around this. Ironically, he succeeded, but didn't realise it! He had passed light through a prism and showed that blue light bent more than red - and that if you pass the spectrum through another, inverted, prism, it will revert back into white light again. An optician named John Dolland had hoped to use this technique to rescue lenses, and Fraunhofer wanted to perfect this.
Lenses, however, are curved - less straightforward than prisms. Fraunhofer was going to have to do some serious testing, to make sure each colour was "bent" by exactly the right amount. To do this, he was going to have to examine the refractive index (http://en.wikipedia.org/wiki/Refractive_index) - for his purpose, the light-bending power of different types of glass. Since each type of glass bent light to a different extent, Fraunhofer needed a source of light that was always a single colour. He chose sunlight.
Galileo's telescope. Credit: http://www.edinformatics.com/math_science/solar_system/solar_system.htm
H-gamma is the third line in the visible-light series of hydrogen lines, all of which end up in the n=2 state (first excited state) of the atom. So H-gamma is the transition between electron energy states n=2 and n=5, and show up most strongly in stars with temperatures hot enough for atomic collisions to put lost of hydrogen atoms in n=5 (stars broadly like Vega).
H and K are the violet calcium lines near 3933/3968 A, D is the pair of sodium lines at 5890/5896, C is H-alpha, A and B come from oxygen in our own atmosphere and have been calibrated out in the SDSS spectra.