Low coolant can do that. Typical cures are trimming the overflow hose at the radiator to get the overflow container working properly (it will just fill up and the radiator becomes more empty), and replacing the radiator cap as the rubber seal can crack and not suck coolant back in when cooling down. Fan sensor can fail, but that is a more remote possibility. Failed thermostat can stick shut as well, but all the ones I have replaced tended to run cold stuck open.