The trick of course is to turn something like that into a lesson. Find out exactly what caused the fog. Was it due to radiation, lake effect or whatever?
Usually when fog rolls in rather quickly it's a local effect, only happening with a certain wind direction and speed, and with a certain water temperature / air temperature difference. Find somebody experienced with the local conditions, and let him/her explain what the conditions were that lead to the fog rolling in this quickly. Next time you'll be able to recognize those circumstances and can be extra weary.