During most of their life, stars are mostly composed of hydrogen and generate energy by converting it to helium. Although other elements are present to give individual stars their "fingerprint" the lines of hydrogen and helium are visible in stellar spectra, as in this tube.