Speed of light is constant and is mathematically proven to be
so. Despite whatever reference frame, you will always see and
measure speed of light to be c.
Eg, if you are travelling at the speed of light c, you will
still see light to be travelling at c. Its a mind-fark yes. So
whether you are on a train or on a speed of light vehicle, whether
you measure inside or outside the vehicle, the speed of light you
measure will still be 'c'. A constant speed that doesn't
change. Amazing right?
In any case, the speed of light remains the same at all
reference frames. So if light is constant, Einstein theorizes that
it is time that dilates. That is the faster you move, time slows
down. The theory is called "time dilation." Go check that out.
=D
Also, gravity does affect light. The easiest example would
be black holes where the gravity is so intense that light does not
escape. The "event horizon" of a black hole is an imaginary
"no-escape" boundary where the velocity of the gravitation is equal
or higher than the speed of light. Hence, "no escape."
The other thing that was mentioned in the posts above is the
doppler effect. Light traveling away from a intense gravity
suffers "red-shift" if i remember my lessons correctly.
http://en.wikipedia.org/wiki/Gravitational_redshift
Finally for the biggest mind-fark of all, as deepak mentioned is
wave particle duality. There really is no explanation.
Light or electrons are both waves and particles. And they
behave differently when they are observed. Yes, observation
alters the the behavior!
http://www.youtube.com/watch?v=1iJG6qkeMxA
Unfortunately, there is no "real" explanation for why the speed
of light is constant or any explanation to wave particle duality.
This is why the more you study physics (quantum n particle),
the less things make sense and add up. So even at university
level, there is no real concrete explanation to the questions you
asked. Questions lead to more questions but still no real
answer.
Hopefully, this will change as CERN fires up its LHC...
hopefully.