Sounds to me like confusion/frustration because he can't get to greet the other dog as he's been used to doing in the past.
A solution to this would be something to distract his attention away from the other dog. If it were me I'd try to stay away from things like anti-bark collars and stick with more "old school" techniques such as a quick shake of a small bottle of stones, when he stops barking you can reward him.
Also if you can train him to bark on command it is very often possible to train them to stop barking on command.