Make/model of the machine would help. I've refurbed a few of the old Dixie Narco and Vendo machines over the year.
As A-duh mentioned, thermostat could be the culprit but also could be cooling fan, compressor, etc.
Check out forums like vending chat and soda-jerks for more info.