Where does water vapor go/what does the sun do?
Simplistically, fog consists of water droplets.  The sun provides energy, which heats the droplets and evaporates them, and also raises the air temperature.  The water is still there, it's just in the form of (transparent) water vapor, rather than light-scattering droplets.

PS: Maybe a similar example would help make things clear.  Say you've just washed some clothes, and hang them on the line, and some time later they're dry.  There was water in the clothes when you hung them out, it didn't drip off the bottom, so where did the water go?  Into the air, as vapor, no?  Same with fog, when the sun raises the temperature a bit.