At the most basic level, our theory of a star is that it is a ball of gas held together by gravity. We will see that this theory, suitably extended, can explain the observed properties of the sun and other stars. In this picture, a star is entirely gaseous and has no solid surface.
Stars are nearly opaque.
The center of a star is hot, so it contains a great deal of heat energy . For the star to be luminous, this energy must get out. Most of this energy is held by the atoms, which are moving rapidly and bumping into each other. However, the atoms are trapped in place by other atoms above them, so this energy cannot move out to the star's surface. Some of the energy is held by the photons, which can carry energy to the surface.