My mere understanding of this phenomenon is since photons have no mass, gravity doesn’t affect light directly.
Rather changes light’s traveling path. Light travels along geodesics and goes through the closest path between two points, which is (approximately) a straight line. But due to gravity of massive objects the space-time in which light travels in is curved. Therefore photons must travel through the curve and it seems light is bent by gravity because the geodesics are now manipulated.

So this was a very interesting question and it’s well answered here in Quora.