Class 11 Nuclear fusion powers the sun. In fact the core of the sun is so hot it makes x and gamma rays as the main type of radiation - these are the shortest wavelength radiation. To understand we will follow the path of a single gamma ray from creation in the core to escape from the solar surface. We shall see that it's not a direct route but takes long and twisting route to escape as the gamma ray leaves the core it passes into the radiation zone. This is a layer of gas above the core made of H and He.
Photons interact with matter via absorption and re-emission.
E. So energy is stolen away from a gamma ray photon via this process of absorption and re-emission. Could fly out in just 3 seconds if not blocked. Then photon enters the convective zone. Somewhat like pot of boiling water. This is the visible surface of the sun.