Yes Marianne, this is supposedly the main reason light bends. The other reason is that under very strong gravitational force, like that close to a massive object like a star, even the fabric of space bends. Yes you read correct, space itself can bend and twist. Space is not nothing but something. Isn't it cool?
I've read a few theoretical physics books and while most of it makes sense, other parts are tough to wrap my mind around and gravitational lensing is one of them. Like, how do scientists know if light is being bent by gravity? Can they detect a shift in wavelengths perhaps?
An explanation of why this occur is this: light is really waves in the electromagnetic field. If you imagine such a wave passing by a star the wave fronts closest to the star gets pulled closer together and subsequently the wave fronts on the other side gets pulled apart. If you try to draw this picture on a paper you'll see the wave curve which is known as gravitational lensing.