Weather Insider: May Gray explained
During the month of May, ocean waters off the coast of Southern California tend to be at their coldest point. The water acts to cool down the air just above it. This creates a temperature inversion where the warmer air sits above the cooler air. Clouds often form at the boundary of the cool and warm air.
During the day, the marine layer/temperature inversion moves inland. This brings cloud cover to cities all along the SoCal coast.
May gray/June gloom are two names for the same phenomenon. As we move into the summer and temperatures rise even more, the oceans start to warm and the persistent gray clouds begin to weaken. As well the shift of winds associated with the summer monsoon helps to hamper the phenomenon.