So how does spacetime become curved? This is the second part of Einstein’s theory. Mass and energy generate curvature. A massive object curves spacetime such that the distance around that object shrinks–the more massive, the bigger the curvature. If a light ray passes by the object, the light ray will be deflected towards the object, because the path to wherever the light is going will be shorter if it goes through the contracted space by the object. This is the cause of gravitational lensing.