Amongst his many other discoveries and theories, Einstein unearthed some important findings about the nature of gravity. Gravity isn't simply a force of attraction between two objects with mass; it's a distortion of spacetime. Just like how a satellite orbits the Earth, if light comes into the gravitational field of a huge object it will also bend to follow the curvature of spacetime. The Earth itself can actually cause light to deflect from the pathway it's taking because it distorts spacetime, just like the sun.
But what's more interesting is the question of whether a black hole can cause the same thing to happen, which was asked to Fraser Cain from Universe Today. A black hole has such a strong gravitational pull that it stops anything from escaping including light, which also can't be reflected, hence it is described as "black", but they're actually invisible to our eyes. The incredibly strong gravity of black holes result in a region surrounding them called the "photon sphere" where sure enough, light is sent into orbit. The closer the object to the black hole, the faster it needs to go; photons of light in the photon sphere travel at light speed. This means that if you stood inside this photon sphere region and shined a torch in a particular direction, you could actually see the light behind you because it would be in orbit. But don't try this at home. You would definitely die.
Learn more from this YouTube video: