Its not an uncommon story. Some person, group, or company needs to do some digging in order to complete a project, so they just start putting shovels or machinery into the ground. Only then do they find out, a little too late, that there's a utility line there.
In an effort to make it easier and more convenient to avoid this fate, the Common Ground Alliance (CGA) created a new phone number that anyone planning on digging should call: 8-1-1. This number was chosen to match the date of Safe Digging Day, August 11, to try an make the number easier to remember as well as bring more awareness to the day.
The way it works is simple. If you are about to start digging, don't. Call 811 and you will be forwarded to a local call center. You tell them where you want to dig, and they will contact the appropriate utility company to send someone out to make sure that the area in which you wish to dig is safe. Bear in mind that this is not immediate. You may not have someone come out for a few days, but that's a small price to pay to avoid a terrible mistake and shouldn't be much of an issue anyway for properly planned projects.
You can find out more at the 811 website, including state-specific information.