When the land heats up, the air above it heats up as well. On the other hand, the ocean heats up and cools down relatively slowly. Therefore, areas near the ocean generally stay cooler during the day and have a more moderate temperature range than inland areas.