How do we determine the proportions of hydrogen to helium (to other elements) that make up the Sun given the absorption spectra?

I am reading about the composition of the Sun and how it is made up of mostly hydrogen (~90%) and helium (>10%) and other elements with much smaller quantities. The explains that different elements give different absoprtion spectra (different lines) yet I do not understand how the proportions were calculated. Can someone explain this to me?


