Above the ocean the air cools down due to the colder temperatures of the ocean water. This leads to the air becoming denser and a local high air pressure zone. The difference in air pressures above the beach and ocean is what causes the air movement we perceive as wind.