Suppose that you have a clock and a ruler (which is not rotating with respect to stars) and that you are not accelerating (inertial). Locally (where you are) you will always measure the speed of light at 299792.458 km/sec. However in the presence of gravity if I am at a different location than yours then I could measure the speed of light at your location to be any value smaller than or greater than 299792.458 km/sec. It depends on where I am and where you are (it depends on locations). So in the presence of gravity the speed of light becomes relative (variable depending on the reference frame of the observer). This does not mean that photons accelerate or decelerate; this is just gravity causing clocks to run slower and rulers to shrink.
Recalling the very famous second postulate of Special Relativity by Einstein (1905): 'The velocity c of light in vacuum is the same in all inertial frames of reference in all directions and depend neither on the velocity of the source nor on the velocity of the observer'
Einstein's theory of special relativity says that the speed of light in vacuum is always measured the same (at 299,792.458 km/s) however this is only true locally for systems that are inertial, which means not accelerating. From Newton's second law: if forces exist implies acceleration exists; this means that if you are in a spaceship and fire your rockets then you are not inertial.
The other factor besides acceleration is gravity. Einstein emphasized in his paper in 1917: 'The results of the special relativity hold only so long as we are able to disregard the influence of gravitational fields on the phenomena'
In 1915 (10 years after Special Relativity) Einstein developed another theory called General Relativity that deals with gravitational fields and according to this latest theory the velocity of light appears to vary with the intensity of the gravitational field. For example, an observer outside gravitational fields measures the speed of light locally (in his location) at 299792.458 km/s but when he looks towards a black hole he sees the speed of light there to be as slow as a few meters/sec. At the same time an observer freefalling into that black hole (zero-g) measures the speed of light locally (in his location) at 299792.458 km/s; when he looks towards the black hole he sees the speed of light there much slower; when he looks away from the black hole he sees the speed of light there much faster. If he tries to resist his freefall into that black hole (by firing his rockets for example) he will not measure the speed of light locally anymore at 299792.458 km/s; instead the stronger the g-force that he feels the faster light appears to him. Again when he looks towards the black hole he sees the speed of light there much slower; when he looks away from the black hole he sees the speed of light there much faster. In any case, freefalling or not, he will never see the speed of light outside gravitational fields at 299792.458 km/s. Finally, there is no difference between the effects of g-forces experienced from these rockets and the effects of g-forces experienced when standing on planets, stars... hence an observer standing on a black hole measures the speed of light locally (in his location) much faster than 299792.458 km/s; when he looks towards outside gravitational fields he sees the speed of light there a zillion km/s.
In the presence of gravity the speed of light becomes relative. To see the steps how Einstein theorized that the measured speed of light in a gravitational field is actually not a constant but rather a variable depending upon the reference frame of the observer: 'On the Influence of Gravitation on the Propagation of Light', Annalen der Physik, 35, 1911. Einstein wrote this paper in 1911 in German (download from: http://www.physik.uni-augsburg.de/annalen/history/einstein-papers/1911_35_898-908.pdf). It predated the full formal development of general relativity by about four years. You can find an English translation of this paper in the Dover book 'The Principle of Relativity' beginning on page 99; you will find in section 3 of that paper Einstein's derivation of the variable speed of light in a gravitational potential, eqn (3). The result is:
Where phi is the gravitational potential relative to the point where the speed of light co is measured. Simply put: Light appears to travel slower in stronger gravitational fields (near bigger mass).
You can find a more sophisticated derivation later by Einstein (1955) from the full theory of general relativity in the weak field approximation: 'The Meaning of Relativity', A. Einstein, Princeton University Press (1955). See pages 92-93, eqn (107); the variable velocity of light expressed in coordinates is:
Simply put: Light appears to travel slower near bigger mass (in stronger gravitational fields). A non-mathematical discussion of this can be found in: 'The Riddle of Gravitation', Peter G. Bergmann, Charles Scribner's Sons, NY (1987). See pages 65-66. Bergmann takes the deflection of light by the gravitational field of a star as evidence of the decreased speed of light in a gravitational field. You can also find modern direct derivations that lead to the same results by Einstein: 'Relativity, Gravitation, and Cosmology', T. Cheng, Oxford University Press (2005).
For the 1911 results see pages 48-49, eqn (3.39):
For the 1955 results but not in coordinates see page 93, eqn (6.28):
Namely the 1955 approximation shows a variation in km/sec twice as much as first predicted in 1911.
Km/sec is a scalar, however gravitational length contraction and time dilation make it impossible to represent the speed of light by a scalar. There is a difference between the radial speed of light and the tangential speed of light. The effects of gravitation can only be accurately represented by a tensor field.
Contrary to Special Relativity, the measured speed of light in a gravitational field is not a constant, but rather a variable depending upon the reference frame of the observer; what one observer sees as true another observer sees as false. The only observers that can actually agree that the speed of light outside gravitational fields is 299792.458 km/s are those who are themselves outside gravitational fields.
Since only in "local inertial frames" does the measured speed of light equals the nominal speed of light (299792.458 km/s) then it becomes important to learn about the types of non-inertial frames:
If you are in a spaceship and fire your rockets then you are not inertial. If you are orbiting the sun then a gravitational force is accelerating you towards the sun; hence you are not inertial either (even if your tangential speed around the sun remains constant). You can find the answer in: "General Relativity", Lewis Ryder, Cambridge University Press (2009).
Page 7: 'There are, however, two different types of such [non-inertial] motion; it may for instance be acceleration in a straight line, or circular motion with constant speed. In the first case the magnitude of the velocity vector changes but its direction remains constant, while in the second case the magnitude is constant but the direction changes. In each of these cases the motion is non-inertial, but there is a conceptual distinction to be made.' Hence in General Relativity, as long as Earth is orbiting the sun then Earth is a non-inertial frame of reference. Earth can only be a local inertial frame if it exits the solar system, or it enters a gravitational freefall towards the sun (straight in from afar).
Similarly in classical orbital mechanics, as long as Earth is orbiting the sun then Earth is non-inertial (accelerated by the sun). However we discovered that outside the gravitational field of the sun 12000 Lunar Orbits/Earth Day becomes equivalent to the local speed of light. An observer near a black hole for example sees the speed of light outside gravitational fields a zillion km/s, but still equal to 12000 Lunar Orbits/Earth Day! This means that if the local speed of light (or the local speed of any object) were defined in km/sec then it will appear to vary for observers in different gravitational fields; however if this speed were defined in Lunar Orbits/Earth Day then it would never appear to vary to anyone because 12000 Lunar Orbits/Earth Day is common to all observers. It also turned out to be a constant forever.
Mobirise page software - Go here