Each of these collisions transfers energy from the photon to the atom, heating up the material at the core, and at the same time reducing the strength of the radiation. These collisions continue until the photons eventually reach the boundary of a more ordered region of the Sun. The radiation photons release their energy into the gas here, and heat it so it rises through the cooler surrounding material. The material surrounding the gas cells is still opaque, so any photons that are emitted cannot escape. Eventually, the density of material drops off to a boundary, at which the sun becomes transparent.
Astronomers call it the 'photosphere'.
This means the radiation it emits is mostly yellow-white light in the visible part of the spectrum. The Sun's interior does a good job of filtering out most of the harmful radiation, and the Earth's magnetic field and atmosphere do the rest.