Crozier,
you are going to have to inspect the well to find out how they are getting in. If you have a submersible system,you might have a broken well cap or the conduit for the wire might have a break in it. A lot of guys will install the conduit with polly pipe in the ground but it only goes a few feet in the ground from the well cap and stops. If the opening to the conduit in the well cap isn't sealed all kinds of critters can get in the well.You also want to make sure you have a good quality well cap that will allow you to seal any openings like the one i pointed out but at the same time vents the well properly. I would find out where they are getting in,resolve that first,and then look into getting rid of the ants by excavating the area they are living in. I wouldn't suggest using any kind of ant killer or chemicals around the well,you wouldn't want to contaminate the ground water.
SAM