I haven't written one of these for quite a while, so it's high time I did. In italic are
lambdapi's questions, somewhat paraphrased for brevity.
Since when does light have mass?
In general, it doesn't have mass, but does have momentum. The exception to this is photons in a superconductor, but that's not relevant to this.
Why is light affected by gravity and why does gravitational lensing happen?
It's because of the general relativity effect of masses disfiguring (popularly known as curving) space that causes light to take a longer path.
This is how I like to think of it, and it's not the common "rubber sheet" idea either. being three dimensional, I think this picture is, well, better.
Ignoring time, space is three dimensional and where there is a mass (such as a planet, star, black hole or galaxy) space is altered. Think of it as the mass condensing* space so that the closer you are to the mass, the denser* space is. (I'm very tempted to use the phrase "fabric of spacetime" right now, but it would just complicate matters.)
Now, suppose light travels through x units of space in time y in empty space very far from heavy junk. When it's close to a mass it will still travel x units in time y, but becasue space has been condensed* in that area, sort of squashed together* it doesn't seem to have travelled as far. If we're talking about light travelling directly away from the centre of mass, this metaphor explains gravitational red shift where the photon's wavelength is extended and frequency reduced because it has to travel through more space, yet appears to be going at the same speed because of
special relativity. Asthough it has to keep up so that it's going at the same speed for observers but is stretched out because there's more space to travel through. Still with me?
Gravitational lensing is where light is bent as it passes a mass (in this case, something in the league of black holes or galaxies) like in
this slightly confusing picture. The purple arrows are the paths light follows and the orange ones are the paths light appears to follow coming from the same source. To explain this using my metaphor, I am going to bastardise the classical notion of refraction (see last proper paragraph
here). Since light bends when it enters a medium with a higher refractive index (where refractive index can be thought of as "optical density"), consider the "denser"* space near a mass to have a higher refractive index. Light entering this denser* space will bend and since the density increase is gradual with distance from the source (proportional to the inverse of the square of the distance from the centre of mass) the light will bend a little bit for each short distance travelled (since the amount of bending is related to the difference in refractive indices) and overall will travel in an arc. (Oh the ingetrals.)
* These aren't strictly accurate words. As I said, it's a metaphor.