#10 wire is the smallest you should use on a 30 amp circuit. In most areas it is not legal to use the Romex type wire in a conduit or pipe, especially underground. By Romex type, I mean the conductors a wrapped in a sheath. The wire is designed with a specific current rating based on the fact that it is not inside a conduit. Individual wires (conductors) should be used inside a conduit. If your receptacle is more than 50' from the power panel including the wire that is inside your house or building, you should be looking at #8 wire to compensate for the voltage drop.
Think of voltage like you would water pressure. If you hook a hose to the faucet on your house that is 25 feet long, you will get a certain flow of water out the end of the hose, now connect another section of hose to the first one and notice that the flow has slowed. The longer the hose the less flow you will get because of the pressure drop caused by the friction of the water traveling through the hose. The same goes for electrical current, the longer the wire the more voltage drop (pressure drop) you will get.
If the drop is too much, you could burn up the motor in your air conditioner or heat pump. That really gets expensive.
By using the correct wire size and receptacle you can save yourself a lot of headaches.