A marine layer is a dense mass of cool, moist air that accumulates over the surface of large bodies of water, especially oceans. It is caused by a temperature inversion, meaning that the air close to the ground is colder, rather than warmer, while warm air above presses down on it, preventing it from dissipating. This phenomenon is responsible for the fog that plagues many coastal communities, and it can also cause unusual phenomena, like campfire smoke that flattens out rather than drifting upwards.
The formation of a marine layer can take place in a number of ways. Generally, air becomes saturated with moisture, causing it to become cool and dense, or it gets cold overnight and in cloudy conditions. Warmer air above will force the cold air back down, creating an inversion. A mass of warm air can also drift in over cooler air, trapping it so that it gets colder and more dense as a result. If the air becomes saturated enough, it will turn foggy. These masses of cool air can also be quite large, extending well up into the atmosphere.
People in coastal communities are familiar with the marine layer in the form of an ominous fog and clouds that hovers on the horizon, waiting for an opportunity to move onto shore. As conditions on shore cool, the air drifts in, saturating the coastline with fog and sometimes light drizzle. Sometimes, inland communities can be extremely warm and sunny; this actually traps the cold air even further, by creating a bubble of warmth enclosing it.
Many communities that experience this type of weather also struggle with smog, particulate matter that pollutes the air. Smog can become trapped in the colder air, and the same temperature inversion tht causes this phenomenon can also create a dense mass of smog. In some cases, smog may get so bad that citizens are warned that they should not go outdoors, as the air quality is extremely poor. Temperature inversions can also occur in valleys or deep depressions in the surface of the Earth, especially if they have large water features, which is why Mexico City struggles with smog even though it is in the middle of Mexico.
Strong winds can break up a marine layer, often by pushing it onto shore so that the sun can dissipate it. Storms may also disperse it, as will turbulence in the air column.