As Gustav Kirchhoff understood [1], Fraunhofer lines are produced when light is absorbed by gaseous atoms located above the level of the solar surface where the continuous photospheric spectrum is emitted.
Thus, Fraunhofer's dark D line reveals the presence of sodium in the Sun, while the rest of the Fraunhofer lines indicate the presence of different chemical elements, including the Sun's major constituent, hydrogen.