Change in frequency of the photon takes place.
Let v' be the frequency of photon on the surface of earth.
Mass of photon = hν / c2
Mass of the photon depends on its frequency, but we will consider the mass to be constant as difference in v´ and v is very small.
Energy conservation gives