EDIT2 replying to comment:
the way a ball bounces back from a totally elastic wall, even classically it is not at rest" would you show me graph of speed of the ball vs time. and if i ask a gentle question What is the speed of ball(and photon) at the very moment of collision(t=t0). As i understand v=dx/dt at (t=t0) it is discontinues how can you say the speed of photon is c at t=t0
Let us not confused the vector velocity, which does change, with speed, which is a scalar and for the photon has the same value always. It is discontinuous at exact t=o classically though. In the classical case of the ball one would use delta functions to describe what happens at the impact on the vector going to infinitesimal times and space locations. At that point one would reach the quantum mechanical domain and with some very complex equations one would be able to describe t=0, with a delta(t) due to the Heisenberg Uncertainty principle. The speed of the ball will be the same after that delta( t), ( from energy conservation of the total elastic scattering) the velocity in the opposite direction.
Quantum mechanically there are Feynman diagrams that describe the interaction of photons with matter,where at the point of "contact" with the fields of the atoms the photon is "absorbed" to a virtual electron and then re emitted. Virtual means the electron is off mass shell, its " rest mass" different from zero for the electron. Once the photon is scattered it is on mass shell again, with rest mass=0 and speed c. Have a look at this chapter to understand the complexity of the matter. And here is a link with calculations and Feynman diagrams for elastic (Thomson and Ra)yleigh scattering.