The reason for the clicking is that when the starter solenoid closes the sudden demand for power reduces the voltage available and the solenoid drops out. As soon as it does the voltage increases and it again switches on causing the cyclic on/off procedure.
The question is why is the voltage dropping?
Firstly test the battery under load or get it tested. It is of no use to put a voltmeter across an unloaded battery as, unless it is totally shot it could still register 12.5+ volts.
If this shows that the battery is serviceable then the problem is a high resistance in the feed cables. Clean the connections in the power line by removing, scraping and re-greasing them. Pay particular attention to the earth lead connections as these are usually low down, out of sight an probably haven't been touched since first assembly.
If these steps don't cure the problem the its likely to be the contacts in the solenoid. Replcaements are available at a much lower cost than replacing the whole solenoid.