A similar thing happened to me when my water pump went out. It would intermittently fail at first, leading to the inconsistent problem. Then in a week or two it gave out completely leaving me stranded on the freeway.
Get it to a shop and look for white crusty stuff near the water pump, indicating a leak. Also, if it starts to overheat pull over immediately... do not let the needle touch the red EVER, or you may have worse problems down the road.