I've been dealing w/ this for awhile,, I've learned ( doggie school)
tug the leash some to distract and say NO (firmly) everytime they do it,, and PRAISE when they dont do it..
Bailey would do this ALOT in class and the trainer said " distract with a sit, or down" something to distract them then PRAISE when they do that.
Worked for us... now he just does a low growl when we pass a dog ( just to let me know that he sees the dog,,and he COULD bark, but he's not) ha

Which is much better!~~
__________________
Rhonda, Bailey, Josie and my angel Bella Rue'
"Until one has loved an animal, a part of one's soul remains unawakened."
~Anatole France~