When exposed to the heat of the sun, soil warms more quickly than water. As the land warms, so does the air directly above it. As this warm air rises, cooler air from over the ocean flows toward the land. This onshore wind may provide a cooling effect for what would otherwise be an extremely hot region. As the sun goes down, the land cools more rapidly than the water. In early evening the air over the ocean is warmer than the air over the land, and the flow of air is reversed producing an offshore wind.