Newton thought that only objects with mass could produce a gravitational force on each other. According to Newton’s theory, the force of gravity should not affect light. Einstein discovered that the situation is a bit more complicated than that.
First he discovered that gravity is produced by a curved space-time. Then Einstein theorized that the mass of an object actually curves space-time. Mass is linked to space in a way that physicists today still do not completely understand. However, we know that the stronger the gravitational field of an object, the more the space around the object is warped. In other words, straight lines are no longer straight if exposed to a strong gravitational field; instead, they are curved.
Since light ordinarily travels on a straight-line path, light follows a curved path if it passes through a strong gravitational field. This is what is meant by "curved space," and this is why light becomes trapped in a black hole. In 1919, a team led by Sir Arthur Eddington proved Einstein’s theory when they observed the bending of starlight when it traveled close to the Sun. This was the first successful prediction of Einstein’s General Theory of Relativity.
One way to picture this effect of gravity is to imagine a sheet of rubber stretched out. Imagine that you put a heavy ball in the center of the sheet. The weight of the ball will bend the surface of the sheet close to it. This is a two-dimensional picture of what gravity does to spacetime in four dimensions. Now take a little marble and send it rolling from one side of the rubber sheet to the other. Instead of the marble taking a straight path to the other side of the sheet, it will follow the contour of the sheet that is curved by the weight of the ball in the center. This is similar to how the gravitation field created by an object (the ball) affects light (the marble).
HubbleSite and STScI are not responsible for content found outside of hubblesite.org and stsci.edu