For much more information, see my dedicated article on navigation in ants.
For long-distance navigation, ants use their eyes – they can see the polarisation patterns produced by star-/sun-/moonlight and use them as compasses. Forest ants, who can’t see the sky, memorise the silhouette of the canopy and make a map of their location.
That’s for getting their general bearings. When going to a certain goal (a food source), they count their steps as a distance measure. After a certain number of steps they will turn back and take a “snapshot” of how far they’ve gone, and they can remember these images on their way back so that they know that they’re on the right track.
On foraging trails or other well-used paths, pheromones can be layed down continuously to keep traffic in order, but pheromones aren’t used much otherwise for navigation because they’re too volatile. Pheromones is how they locate their nest when they’re close to it, though.