The sea breeze and the land breeze are alike. Each is caused by the differing ways that water and land absorb and retain heat. These thermal differences produce a circulation that moves air from sea to shore and back again.
The sea breeze
The same sun shines on both land and sea. However, sunrays penetrate deep into the transparent oceans, and then turbulence disperses their heat through a deep column of water. In contrast, only the first few inches of the land are heated by the sun. The shallow heat of the land is readily radiated back into the air. So when the sun shines, the air is warmer over the heat-radiating land than over the heat-absorbing sea.
This heat emitted from the land causes air near it to heat up and expand. As it expands, it rises. This lowers the air pressure directly over the land, creating a thermal low. Over the ocean, however, the air is relatively cool and dense. It stays near the surface, and it flows onshore.
This cold air pushes under the warm land air, making it rise. On land, the air temperature drops as the sea air flows in, and the air is suddenly moist, and sometimes full of the smell of the sea.
At a higher level of the atmosphere, the warm land air cools as it rises. It contracts and becomes denser. It goes out to sea in a return flow that equalizes the pressure difference caused by the sea breeze below it. Over the ocean, it cools and sinks down to take the place of the sea air that flowed in onto the land.
Because winds are named for the place of their origin, this refreshing air from over the ocean is called a sea breeze. It cools the land near shore, and sometimes areas miles from the ocean.
These few miles sometimes hold colonies of vacation cottages, where summer visitors can escape the heat and enjoy an ocean breeze.
The land breeze
At night, on the other hand, the land sometimes loses heat more rapidly than the deeply heated ocean does. The land becomes cooler than the ocean. Therefore, the lowest layer of air over the land is cooled more rapidly than the air over the water is. It becomes denser, and forms a high pressure area. Then, this cool air from the land flows out to sea.
This undercuts the relatively warm and light air over the water, making it rise. The rising air forms a high pressure area above the ocean, and its air flows towards the low pressure area above the land, to equalize the pressure. Over land the air cools and sinks, causing an increase in pressure and density, and this air again flows out to sea.
The circulation of a land breeze is a mirror image of sea breeze circulation. It is rarer though, and somewhat weaker, at least partly because the trees and other vegetation of the land slow a land breeze with friction.
People who live near the ocean often smell it in an afternoon breeze, while sailors sometimes smell the fragrant hidden land, on a dark night out at sea.