AC works for transmitting over long distances - above ground. If you put a very long cable in the ground and want to transmit a lot of power through it, what you're building is a giant capacitor. If AC is used for power transmission in said cable, the capacitor will be "charged and discharged" at the frequency of the grid, so at 50-60 hz. This doesn't take "Real Power", but it takes a lot of "Reactive Power" (AC power - Wikipedia, the free encyclopedia). When the line becomes too long, the share of Reactive Power becomes too big, and you'll hardly be able to transfer any real power through it. DC doesn't have any reactive power to it, so the problem doesn't arise. (The capacity of the cable is charged only once, when the line is turned on.)
The reason we use AC in the grid (which is mostly above ground) is, as others pointed out, because we can transform it to higher voltages much more easily than DC, and that's a prerequisite for long distance power transfer in both AC and DC (the ability to switch AC off more easily is also a big plus). With modern power electronics, HVDC lines can be realised, and they have been in a number of instances. There was a big-ish discussion in Germany about how to connect off-shore wind farms (as they have to use cables), and in the end HVDC won out because using AC through a cable of the proposed length would not have been feasible.
The reason we use AC in the grid (which is mostly above ground) is, as others pointed out, because we can transform it to higher voltages much more easily than DC, and that's a prerequisite for long distance power transfer in both AC and DC (the ability to switch AC off more easily is also a big plus). With modern power electronics, HVDC lines can be realised, and they have been in a number of instances. There was a big-ish discussion in Germany about how to connect off-shore wind farms (as they have to use cables), and in the end HVDC won out because using AC through a cable of the proposed length would not have been feasible.