One of the predictions of general relativity is that clocks in the region of a gravitational field run slowly. A clock on the ground floor of a building will run more slowly than a clock at the top.
Equivalently, light moving away from a mass undergoes a drop in frequency. You might imagine the photon as a ticking clock. A photon emitted as a result of a transition on the ground floor has a lower frequency on reach the top floor than a photon emitted as a result of the same transition.
The shift in frequency can easily be calculated using the mass equivalence of the energy of the photon. As the photon moves up through a height h, it experiences an increase in gravitational energywhereThis increase in potential energy comes from a decrease in the energy of the photon,
Hence
If light of frequencyis emitted from the ground floor of a building 100m high, it will experience a decrease in frequency of magnitude