How do boats sail into the wind?

Sailboats have large sails that are shaped like airplane wings, only sticking straight up. When air moves over the sail, lower pressure is created on one side, and higher pressure is created on the other side, creating lift (much like an airplane wing). This force would just move the boat sideways through the water, but a keel (a big fin going down the centerline of the boat) creates resistance to sideways movement. So the combined forces result in forward motion. his has limits however, because the sails have to take on the wind at a certain angle (which is done by adgusting the sail with ropes to swing it further in or out), which means that most boats can only sail about 35-45 degrees into the wind. To go straight into the wind, boats have to beat, which is zigzagging up into the wind.