How can we get absorption lines in solar spectrum instead of emissions lines at such high temperature?
Is solar spectrum contains emission lines?
The solar spectrum itself originates as a close-to-perfect blackbody emission for an object at about 5800K. That is what produces the nice curve you see. The absorption lines in the spectrum are not always something that comes from the Sun itself but, in most common situations, the absorption lines you will hear referred to are from the atmosphere of Earth.
The multitudinous gases in Earth's atmosphere each have their own spectra of wavelengths that they will either absorb to become excited or emit when they are excited. As the light from the Sun passes through the atmosphere, it encounters these gases and some of the light is absorbed. Gases like Nitrogen, which makes up a majority of the atmosphere, will contribute more to the absorption spectrum; it has a fairly broad spectrum itself, so it tends to decrease the relative intensity across most wavelengths. More active gases like oxygen, water, and ozone have a more noticeable impact on the absorption spectrum; you'll see deeper absorption bands at some of their more dominant wavelengths.
Absorption lines are produced primarily by material in the atmosphere of the sun (the chromosphere): higher up than where the light is primarily emitted (photosphere). Emission lines are also produced in all layers of the surface layers, but especially in the optical they are not very pronounced compared to the absorption lines.