Spectral Interpretation 101: Theta Ophiuchi, a hot star
This next example is slightly further up the temperature scale at about 20,000 K. The number of lines is much reduced as the heat has changed the atoms so that the atomic states found in the Sun's atmosphere aren't so popular and the associated lines are no longer visible. You'll notice also that the main line near the middle isn't present in the solar spectrum. It is due to neutral helium (He I in astrospeak) which thrives at these higher temperatures. The D lines here aren't due to sodium around the star, but rather are from some intervening gas somewhere between here and the star, probably in our own atmosphere. The rapid rotation of the star also helps to make the helium line wider than the sodium lines and the lines in the solar spectrum. Its the doppler shift at work: one side of the star is approaching us giving the bluest parts of the line, the other limb is moving away providing the red side.