This question already has an answer here:
Why has the speed of light in a gravitational field always the same value $c$ when measured locally?
More precise: When you are far away from any masses, that means when the spacetime is flat, and you measure the speed of a light ray that passes you, you will always get the same value $c$. Now suppose you are in a static gravitational field at a fixed position, and do the same. Why do you also measure the same value $c$? (Please note: You are not in a free falling system where gravity vanishes)