Ants don't follow each other; they follow a scented path known as a pheromone trail. If you spray the trail with Windex or any glass cleaner that contains ammonia, the scent will be destroyed.