A star shines by nuclear fusion between particles at the center of the star. It is the force of gravity which presses the particles so close that they can fuse. During this process two positrons are generated. The positrons travel out from the center of the star and soon meet two electrons. These are identical in size but opposite in charge.
Positrons are antimatter electrons.
When matter meets antimatter they annihilate each other, converting their mass energy into radiation. This radiation leaves the star as starlight. Also protons boil off the surface and travel out as a solar wind . This is what the rays represent in our diagram of a star. This stage in a star's life lasts for billions of years.