According to Einstein's General Relativity Theory,light will be affected in the same way matter is affected by gravity. This is because under this theory, we should think of gravity not in terms of vector like forces, but as a consequence of the "shape" of the universe.
From Newton's point of view, gravity was a linearly directed force with which all objects with mass pulled on all other objects with mass. His analysis showed that the strength of the force was proportional to the product of the 2 masses attracting one another, and inversely proportional to the square of the distance between them. Thus an apple and the earth would pull toward each other, and the apple "falls" from the tree. Since light (whether perceived as a ray or a photon) has no mass, Newton's equation predicts that it will not be attracted by gravity towards anything, no matter how massive.
In order to construct a theoretical framework that would be consistent to all observers and that did not rely on some independent fixed reference frame, Einstein had to discard this perception of how gravity works and devise a new understanding. According to this theory, all object with mass alter the curvature of spacetime, the 4 dimensional fabric of the universe. Objects moving through spacetime then simply follow the curves that have been created.
Since human brains are not good at picturing things in 4 dimensions we usually resort to an analogy in 3 dimensions. Imagine spacetime as a sheet of rubber, stretched flat when there is no matter present. If we place a massive object like a star in this "space" it pushes down into the rubber sheet creating a dimple or pit in the rubber. an asteroid flying by the star would not travel in a straight line as it rolled along the sheet, it would curve as it went through the dip, coming out in a new direction. If an object were going just the right speed, it might get stuck in the dimple and travel around the star in an orbit like a ball around a roulette wheel. So far the predictions of this theory are the same as Newton's, but now comes a big difference- if light traveled along this rubber sheet of spacetime, it would follow the curve too, since the curvature of space is already created by the star. In fact if the pit is deep enough and the walls very steep, the light might fall into the pit and never escape. (what we call a black hole) Newton didn't notice this bending of light because it takes very massive objects to get something as fast as light to curve enough that you can notice. This is the same reason we still learn and use Newton's equation - it works well most of the time. But experiments have shown that in fact Newton was wrong and light IS attracted towards object with mass, as Einstein's theory predicted.
Answered by:
Rob Landolfi, Science Teacher, Washington, DC

According to Newtonian gravity, light is not affected by gravity, as light is massless. Einstein's law E = mc^{2}, immediately suggests that light is affected by gravity. This is indeed the case and has experimentally be observed via gravitational lensing and other effects.
The classical propagation of light in general relativity (GR) is given by Maxwell's electromagnetic equations and the Bianci identity
dF = 0
and
d*F = 0
Where d is the exterior derivative, F is the field strength 2-form and * is the Hodge duality operator.
The easiest way to describe light rays and light cones is through geometric optics. In this approximation the electromagnetic field is written as a slowly varying amplitude and a rapidly varying phase.
Using this approximation in Maxwell's equations we see that light travels along null geodesics (ds = 0). Also, the wave vector and the polarisation are parallel transported along these null geodesic rays. The amplitude varies as the beam is focused or diverged. The dispersion relation is k^{2} = 0. (k is the wave vector).
This means that light cones are identified with null cones in the space-time and the dispersion relation k^{2} = 0 . Put simply, light cones are the same as the null cones and both describe the causal structure of the space-time.
The method is "simply" to solve the null geodesic equation which will give you the paths light will travel.
So far what I have said is general and of course may be in practice very difficult to calculate. The obvious example to consider is the Schwartzschild space-time. Any book on GR will cover this as this space-time is about the only one ever experimentally observed (apart from cosmological solutions).
Solving the null geodesic equation for this background gives a deflection angle of 4m/R where m is the mass of the star and R is the radius of the star. This was observed by Eddington in 1919 and was used as proof that GR is right.
Answered by:
Andrew James Bruce, Grad Student, UK

'A scientist is happy, not in resting on his attainments but in the steady acquisition of fresh knowledge.'