Yes, light, just like matter, is affected by gravity. Einstein's theory of general relativity says that space and time are not "flat," in the sense that they aren't absolutely unchangeable. Gravity can be thought of as the slight curvature of space and time. It's very difficult to give a very clear illustration of three dimensional space being "curved," but it dictates how things like the Earth, stars, and light move through space. I've loaded a picture (borrowed from here
) that attempts to illustrate just this.
Notice that the space around the sphere in the picture is scrunched up around it. From Newton's First Law, you know that things in motion want to follow a straight line. You can imagine that the Earth going around the Sun is, in fact, following a straight line, but in a curved space like in the illustration. The curvature is tight enough and the Earth slow enough that it circles in on itself, which produces the orbit of the Earth. Light will do the same thing; it wants to follow a straight line, but is curved along the scrunched up space.
Hope this helps,
"General Relativity: The Art of Bending Nothingness." <http://library.thinkquest.org/27585/what/what7.html
(published on 03/01/11)