R-man makes some good points.
Flat spots in the starter usually will cause it to remain inoperative until the starter actually is moved. Weak power to the solenoid could be your problem.
Check your battery, make sure its up to snuff. Low volts can still normally start the car, but not let things like solenoids be reliable.
If your car is automatic, try starting the car in NEUTRAL when hot. If that makes a difference (this is a reach) then the position switch may be going bad.
Check the connector that plugs into the starter, should be clean, and the wire connection to the connector undamaged.
Chris