14 xp 1000 overheating

Went riding this weekend and my rzr started to get hot so I turned it off, and left the key on with the fan running it got to about 235 and puked coolant out of the overflow jug. Then it cooled down and pulled the coolant back down, it was still a little above the minimum line. We rode for a little while longer, and got lost and wound up in the exact same spot. My rzr got hot again, so I turned it off and left the key on so my fan would run it cooled down again, only thing different was it did not come out of the overflow this time. We continued on and it ran fine the rest of the day, it seemed like the thermostat was stuck closed then opened and let the coolant to go back down in the overflow jug. Also when it was spewing out the jug, the hose on the passenger side of the car was hard, and when the coolant returned the hose was soft enough to squeeze. What do you guy’s think? Any help will be appreciated.