We investigate theoretically and numerically the impact of an elastic sphere on a rigid wall in a viscous fluid. Our focus is on the dynamics of the contact, employing the soft lubrication model in which the sphere is separated from the wall by a thin liquid film. In the limit of large sphere inertia, the sphere bounces and the dynamics is close to the Hertz theory. Remarkably, the film thickness separating the sphere from the wall exhibits non-trivial self-similar properties that vary during the spreading and retraction phases. Leveraging these self-similar properties, we establish the energy budget and predict the coefficient of restitution for the sphere. The general framework derived here opens many perspectives to study the lubrication film in impact problems.