Cecilia Payne (1900-1979), or Cecilia Payne-Gaposchkin after her 1934 marriage, took the data from the HD Catalougue and discovered its physical significance. Payne argued that the great variation in stellar absorption lines was due to differing amounts of ionization (differing temperatures), not different abundances of elements. She correctly posited that silicon, carbon, and other common metals seen in the sun were found in about the same relative amounts as on earth but the helium and particularly hydrogen were vastly more abundant (by about a factor of one million in the case of hydrogen).
Most astronomers at the time believed that stars are made of
heavy elements, and when she sent a draft of her paper to
Dr. Henry Norris Russell, he replied that her result concerning
the abundance of hydrogen was "clearly impossible."
Pressured to defer to Russell's expertise, Payne added to
her thesis the comment that her results were "almost certainly not real."
However, within a few short years, most other astronomers had
come around to believe Payne's results and Russell published
his own paper claiming the Sun was mostly composed of hydrogen.
In her autobiography, Payne-Gaposchkin wrote,
"On the material side, being a woman has been a great disadvantage.
It is a table of low salary, lack of status, slow advancement...
It has been a case of survival, not of the fittest, but of the most doggedly
persistent."
What lines you see depends primarily on the state of excitation and ionization of the gas.
These are determined primarily by the temperature of the gas.
For example, the Hydrogen absorption lines which appear in the optical region of the spectrum are created when electrons move to higher energy levels from the second excited state.
B Stars (11,000-30,000 K):
Most of H is ionized, so only very weak H lines.
A Stars (7500-11,000 K):
Ideal excitation conditions, strongest H lines.
G Stars (5200-5900 K):
Too cool, little excited H, so only weak H lines.