Please forgive the question, but I have zero background in such matters. It just seems like a logical question...
Photons have no "rest mass". They are essentially zero-mass. In fact, objects with zero mass must travel at light speed.
E=MC2 does not say you can't reach lightspeed.
The Lorentz equations are the operable ones. They predict that the mass of a body increases without limit as "C" is approached. In essence, the energy you are putting in to "push" the object to go faster just gets soaked up in its increasing mass, not in velocity.
Photons have no mass, but the do carry momentum.
The reasons that light is affected by gravity is that light always follows "space-time geodesics". Ordinarily, such geodesics are "straight lines". Near a large mass (like the Sun or a black hole) the geodesics of space-time are not "straight" but bent by the gravitation of the body. Therefore light departs from a "straight line" and travels in a curve. This is because--in effect--the warping caused by the mass causes a curved path to be the "shortest distance" for the light to travel.
--Boris
If so, then how does light travel at the speed of light? The condition above does not hold: light has zero rest mass.
why is it effected by gravity? It is not affected by gravity directly: the space trough which it travels "changes" in the presence of gravity.