For something so imperative to our existence (and the existence of the universe in general), the concept of gravity is not well understood. This is unfortunate. Since it is intrinsically tied to space, time, matter, and mass, it is intrinsically tied to our understanding of the cosmos. Without it, matter would not be compelled to accumulate, therefore there would be no attraction for our sun and the Earth to form. Obviously, no sun and no Earth = no us. So we know that gravity is important, but what is it?
To put it simply, according to Einstein (and his theory of general relativity), gravity is the result of the warping of spacetime created by objects that have mass. One of the best comparisons I've seen tells us to imagine a blanket and a bowling ball. If you are holding it up and drop a bowling ball in the center of it, the sheet will distort. This distortion of the blanket is akin to the distortion of spacetime caused by mass. This is important in understanding the behavior of light as it travels through space since the affects of this distortion impact light as it travels.
Spacetime itself is also curved. This means that photons never travel in a perfectly straight line. In the theory of relativity, light cones form 'points' near the sun that become slightly bent inward. This is because of the distortion of spacetime that is caused by the Sun's mass. So, if the traveling light from a distant star passes close to the sun, it would be deflected by a small angle, which would cause the star to appear on Earth in a different (and sometimes misleading) position relative to other stars. Of course, if the light of any distant star always had to travel close to the sun relative to our point of view, we wouldn't be able to tell the light was being deflected. We would probably assume the star was really located where it appears to be. Very interesting observation, right?
However, this altered path can clearly be seen whilst monitoring the changing position of stars as our planet travels in orbit around the sun. But we also have to bear in mind that the sun is incredibly bright, making it difficult to pinpoint a star's position relative to other stars that travel close to the sun. However, there are ways around this problem. One of these is comparing our data to that of data collected during a solar eclipse, when most of our Sun's light is obstructed for a small window of time by the Moon as it comes between the Sun and the Earth. In this sense, the Moon acts as a natural dimmer, helping us determine which stars are deflected whilst also verifying some of the predictions made about general relativity!