Try wrapping each developing ear in a netted material such as strips of panty hose to keep the squirrels and birds from damaging the ears. Ants love sweet foods, so when they first appear on your corn, offer them something sweeter? Pure sugar or sugar water might be a diversion from your corn. Set it out close enough for them to find it, but away from the corn. Don't put it out until you see the ants, so you don't attract them to the corn! Of course the ants could be a sign that your corn was being attacked by aphids. Aphids are tiny insects which often cluster on the undersides of leaves. Ants are attracted by 'honeydew' which the aphids secrete. They can be controlled by hosing them off, or with an insecticidal soap spray. Once the aphids are gone, the ants should leave also.