Athletes must always factor in the impact of weather upon racing. Ideally, train in or simulate the weather conditions in which you expect to race. Unfortunately, predicting weather is quite difficult. Ironically, my 20K PR was set in temperatures hovering around freezing. A scant two days earlier, the weather was in the sixties. There was no way for me to prepare on such short notice. Fortunately, 30-degree weather swings occur rarely, so a little preparation goes a long way.
If you know your race-day weather will be hot and humid, then train in hot, humid conditions. If you plan to travel to a race where conditions differ from where you live, simulate them. When I trained for the Macabbiah Games, I needed to prepare to race across what amounted to be a desert. Living in Washington, DC, in July of 1989, I faced very warm and sticky conditions. Still, to prepare as best I could, I trained at noon in a sweatshirt every day.
When weather is cold and/or rainy, the best defense is to dress in disposable layers. This way, as you heat up after the start, you just toss your unneeded layers aside.