No high-energy photons from the core reach the surface at all. The sun is opaque to these photons 100% of the gamma rays released by nuclear fusion and X-rays from the central part of the sun are absorbed by the dense plasma that forms the sun.
Gamma rays and X-rays are both high-energy photons. The difference is how they are formed: X-rays from the interactions of electrons, gamma rays from the interactions in nuclei (and in the sun, from the fusion of nuclei) Gamma rays tend to have a higher energy than X-rays, although there is some overlap.
The sun is made of fully ionized plasma, there are no "atoms" only atomic nuclei (mostly hydrogen and helium) and a lot of free electrons. In the sun, this plasma is compressed very to form a very dense substance. It is much denser than lead. Lead has a density of about 11g/cm³, the core of the sun has a density of about 160g/cm³. It is this high density of both nuclei and electrons, as much as anything else, that makes the core of the plasma completely opaque to gamma radiation.
The surface of the sun (the level of the atmosphere at which it becomes transparent to light) is at a temperature of about 5800K, and so too cool to emit (more than a negligible amount of) X-rays.
Instead, all the X-rays produced by the sun are emitted by the sun's atmosphere. Here magnetic fields heat the (thin, rarified) plasma to millions of degrees, and it is this superheated plasma that emits X-rays.
Gamma radiation can be produced by the interaction of the sun's atmosphere with cosmic radiation.
The X-ray flux is coming from the thin atmosphere and is much lower than the flux of visible light from the sun's surface. (By a factor of about ten million).