Since light is energy and energy is equivalent of mass, so light gets bent by the gravity and this phenomenon is known as gravitational lensing.