While its never a good idea using insect killing chemicals anywhere near your hives (obviously) if the ant problem is so severe, I'm talking so severe that its a matter of the ants overruning the hive. Up here in the northwest we don't have the ant problem like down south. I have seen some really bad ant problems visiting my uncles commercial operation in Texas. I'm talking thousands of ants crawling all over and into the hive. He said for the most part the bees keep them out but he has lost weakened hives to marauding ants and he has had to use ant killer on the anthills within feet of the hives. If its your hives survival or eliminating the ants then you'll have to consider some more drastic options.
Follow the trail of ants and locate their nest, then very carefully spray down the nest opening and cover it up with some dirt afterwards. Use the wasp nest spray that comes out in a thick stream and not a mist so you can direct it right down the opening without it creating a mist in the air. I've used Terro ant bait around the house with good success. You can buy it in small containers that dispense the liquid bait which the ants ingest and then take it back to their nest to spread it around. The containers are designed in a way to let the ants in to feed but the bees cannot reach the bait. As an added precaution you could put a clay flower pot or other cover over the bait traps. If your hive is sitting on a raised pedestal you could put some Tanglefoot on the bottom of the legs to prevent the ants from climbing up to the hive. I've also heard of people using propane burners on anthills. The idea is to knock their numbers down. Killing them at their source is the best way.
I would try the non toxic approach first and hopefully that works. If it doesn't though, you may have to bring out the big guns using a safe common sense approach.