I am a high school student and I am very confused in a topic which is related to sun's spectrum, My teacher told me that the dark lines which we see in sun's spectrum are called fraunhofer lines and it forms because the elements in chromosphere of sun absorbs some of the wavelengths, and he also says that fraunhofer lines can be explained by kirchhoff law, but I don't understand how kirchoff law can explain it?
kirchoff law simply states that at thermal equilibrium emissivity of a body equals to its absorptivity( I am also confused in another thing that if emissivity equals to absorptivity only at thermal equilibrium then why do we only use emissivity while writing the formula for rate of heat loss due to radiation?we should separately use absorptivity for absorption part and emissivity for emission part?), what does it has anything to with fraunhofer lines? please explain it in a simple language so that I can easily understand {remember please I am only at high school level}