The ACS survey of Galactic globular clusters XII. Photometric binaries along the main sequence