All objects with mass warp space-time around them; the more massive an object, the more pronounced the warping it causes. When photons travel through the region near a massive object that has caused significant warping, they follow curved paths because the space-time through which they are moving is curved.
Astronomy: Roen Kelly