Is the Sun considered to be a black body as a whole or it is only the photosphere which is a black body? I am having some difficulties understating how fusion inside the Sun is connected to the Sun being a blackbody. How do the photons transfer to the photosphere? Is the amount of transferred energy less than the energy released in the core?
To my understanding gases like helium and hydrogen absorb some of the blackbody radiation in the photosphere resulting in gaps in the absorption spectrum. Why doesn't this happen in other layers of the Sun and only in the photosphere? In which phase do the atomic excitation and photon emission take place? Is the Sun considered to be a blackbody as a whole or it is only the photosphere that is a blackbody?
To sum everything up, what happens inside the Sun from the standpoint of physics?
 A: The photons produced in fusion do not transfer their energy to the photosphere - their mean free paths are less than 1 mm. That is because the solar interior is opaque to its own radiation.
There is a process of radiative diffusion, whereby because of the temperature gradient in the sun, there are slightly more outwardly than inwardly travelling photons. This gradually transfers the fusion energy outwards. To first order, all the energy released by fusion ends up being radiated by the photosphere (small amounts go into neutrinos, the solar wind, heating the corona etc).
Blackbody radiation is not a mechanism. The radiation in the interior of the Sun is very close to a blackbody spectrum because the mean free path of photons is short and the radiation and matter are in thermal equilibrium. This breaks down at the photosphere, where the mean free path becomes large and photons can escape. Absorption lines are formed because at those wavelengths the mean free path is shorter and the photons escape from higher in the atmosphere at lower, and less bright, temperatures.
The photosphere of the Sun is not a blackbody. We receive radiation that was emitted at a range of temperatures at different wavelengths. The spectrum roughly approximates a blackbody curve only because the temperature gradient in the photosphere is shallow enough that most of the emergent photons come from regions that vary in temperature by only $\sim 10$% and because the major continuum opacity source in the photosphere (photoionisation of H$^{-}$ ions) has a weak wavelength dependence. The same is not true in all stars - see the photospheric spectrum of a cool M dwarf for example.
