(NOTE: I am an 8th grader, so I may not be capable of perfectly elaborating my point by scientific measures. Also, English is not my first language)

I have read that the speed of light is constant, and does not decrease unless under certain circumstances (such as going through dense and/or thick material.)

When a ball hits the wall and rebounds, it has momentum, except for the moment that it hits the wall, since the speed would be 0 there.

How about light? How can light maintain a constant speed upon hitting something? Shouldn't the speed of the photons be zero when they are neither moving forward nor backward when they have hit the wall?