Explanation:
The curves are a consequence of gravitation. The spacetime curves are called geodesics, and they generalise the notion of straight lines to curved spacetime. Light also travels along geodesics (called null geodesics), and so paths of light are also curved by gravitational force, despite the light not having any mass.