Electrical switches can generate a lot of heat when the contacts are marginal. The solenoid could be getting hot because of this. It gets hot and the marginal contacts are not efficient enough to conduct enough power to turn the starter. It cools down and then they are 'marginal' again. You could be describing a solenoid on it's last legs....and fading.......