The solenoid will get warm because it's engaged as long as your foot is pressing the throttle. It could be over charging and causing the solenoid to get hot. Hook a volt meter on the battery and run the cart at half to full throttle and see how how the voltage goes. Are you using a golf cart solenoid?
I would check the charging voltage just to rule it out as being a problem or not. If the solenoid is getting hot I would check the cable connections on the battery and solenoid and also make sure any grounds are clean and tight. Then drive the golf cart and if it quits running check to make sure it has spark right away as soon as the engine quits running.
Does anyone have any ideas on my previous posts? After half hour of run time in forward, engine will not turn over in forward so can't check spark in forward. Engine will start in reverse so must still have spark. The golf cart runs for half then same problem in reverse. Voltage is around 14,14.2. After sitting for awhile it runs great again on short runs. When this happens, solenoid have voltage on battery side, key on, press pedal, voltage not coming back out to starter. Something is causing solenoids to get hot and fail.