Astronomers can determine the presence various elements in a star through spectroscopy of the incoming light from that star. The characteristic spectral lines of each element are formed by electrons transitioning between the various orbital energy levels around the nucleus of their atom. But stars are in a plasma state. The electrons and nuclei are moving around too fast for stable electron orbits to develop. So how can you do spectroscopy on a star if you don't have electrons in orbits around nuclei?