Newton's 3rd law says that for every force there is an equal and opposite reaction force.
So for the force of the hammer hitting the nail, there is a force equal in magnitude exerted back on the hammer by the nail (and is "opposite" because it's in the other direction and on the hammer.)