Oh dear. I’m afraid Ring is about to show up and come down on this thread with the obligatory “LIGHT HAS NO MASS AT ALL AND THE REST WHO SAY THAT IT DOES ARE SPEAKING NONSENSE!”
Well, that’s actually true. Technically speaking light has no mass.
But what does that mean in a practical sense? If I put a box with a photon inside of it is lined with (impossible) mirrors that are 100% reflective, will the system’s mass be larger or smaller than a plain empty box?
Well, it depends on how you look at it. In one way, the system actually has a higher mass! This is one place where the fundamentals of E/C^2 mass come into play for light.
Light, with zero rest mass, cannot bend space as it travels. It can only do that if it is a reference frame that allows it to do so and it must be in an interactive system (sort of like my photon in a box). This may seem strange at first, but think of it this way… light’s energy is all spent up in propagation (at the topspeed of the universe), it spends no energy on twisting spacetime. The energy of a thing with non-zero restmass will spend some of its energy on the twisting of spacetime. That’s one way of looking at what makes the thing have a nonzero-restmass.
We were talking in another thread about dimesions. One way to look at Energy (or mass energy) is in terms of dimension. Mass gets treated like time, as it has one degree of freedom and momentum gets treated like space as it is three degrees of freedom. The metric E^2-p^2 is therefore an invariant quantity for all formulations of “stuff”.
Light in and of itself has no restmass. This means that E^2-p^2 is zero. A direct consequence of this is that light does not warp space as it travels through it. It travels through space on geodescics, always at the speed of light, and it never slows down. When we put it in another medium, the speed of light appears to change, but as Qwerty rightly pointed out, that is due to interactions the light has with other constituents of the system.
That does not mean that a system that has mass cannot be converted into light. It just has to be converted into light in such a way the the metric measurement of the fourvector is conserved (E^2-p^2). This means that in certain ways of looking at systems of light particles (photons) you can have nonzero restmass. This is somewhat similar to the photon in a box analogy I opened with.
In short, does light have mass? no. Can we get light to behave like we would expect a massive particle to? sort of. As with most things, it’s all in the way you look at things. Physicists, to avoid this utter confusion are abundantly clear. Light does not have mass, and a photon observed in isolation does not bend spacetime. It merely travels through spacetime on a geodescic.