If the battery is in good condition ie it holds 12,3 volts without losing voltage, then the issue is probably the connections to the starter motor. The connections get crudded up or even becomes loose.
They need taken off cleaned up and re-tightened. Especially the small connector to the solenoid.