The chemical makeup of a star's surface is usually inferred by analyzing its spectrum. When light passes through a star's atmosphere, certain wavelengths of light are absorbed by the elements present in the star. This results in dark lines, called absorption lines, in the star's spectrum.
Each element has a unique set of absorption lines, acting like a fingerprint. By comparing the absorption lines in the star's spectrum to known absorption lines of elements on Earth, scientists can determine which elements are present in the star's atmosphere.
For example, if a star's spectrum shows absorption lines that match those of hydrogen, helium, and iron, it suggests that these elements are present in the star's surface.
Additionally, the intensity of the absorption lines can provide information about the relative abundance of each element. The stronger the absorption line, the more abundant the corresponding element is in the star's atmosphere.
Overall, by analyzing the absorption lines in a star's spectrum, scientists can infer the chemical makeup of its surface, revealing the elements present and their relative abundances.