I haven't run into it yet this season, but a couple years I ran into white mold on the surface of the potting soil..it didn't do my tomato plants a bit of good.
What is the cause and how do I prevent it from happening ?
White mold on the surface is harmless, and comes with excessive moisture/humidity. I had a little of it this year, and it didn't do my plants any harm.
Agree with catman.
Just scrape it off; no treatment is needed.
In my experience it's more apt to appear when using anything peat based as a container, which is why I've used only plastic cells for seedlings for about 20 years now.
scrape it off & make sure the plant has good air circulation and plenty of sunlight.