The best way to train for this is IMHO not to startle the dog from barking, including with corrections, which only tends to work a few times and won't work at all for a really reactive dog (like Lily!) -- but to actually address and change the context for the behaviour and thus extinguish it, not deflect it. Also, punishment (corrections or startling noises) often tends to only make the dog fearful of that one context -- when it is with the handler who does the punishment. Worse, it simply confirms to the dog that its fearful, wary or too overexcited reactive behaviour is exactly appropriate because bad or startling things happen when other dogs go by.
You want the dog to stop associating other dogs with something they should react to, and instead do the dog equivalent of a shrung and a 'so what' -- or else, think 'hey, there's a dog so it's time to check in and look at my owner to see what happens next'.
This is a training issue and like any attempt to address behaviour, takes time and dedication. The key is 1) socialising the dog in a wider context so it stops getting overexcited by dogs seen across the road (eg attending a class or two), and 2) Taking the time to train the dog so that it always responds quickly to 'look!' , 'sit!' and a downstay. A dog that knows 'look', and which will go into a sit or downstay, and remain looking at YOU, is not a dog that is barking at other distractions.
**This does work.** I have worked enough with Lily that I can always get her to immediately look to me and about 50% of the time now, she will choose to immediately sit and look at me, and stop barking. Now that she has these two behaviours well learned as a foundation for addressing the dog issue, my next step is to take her *alone* and work with her in the park where I know we will encounter other dogs, and to get her back to obedience classes where there are other dogs around and where after a few classes, I know she will very quickly stop seeing them all as things that need to be barked at.
I know her ability to settle down is totally contingent on the amount of time I will put into working on this with her. For whatever reason she is easily overexcited at almost any situation and barks in excitement. But I know she is smart and food motivated and trains quickly once she gets a concept. I had to spend much of a summer working on her frantic barking inside the car every time we go to the park. She used to bark nonstop once the car stopped in anticipation of the excitement of getting OUT of the car
and by rewarding her the instant she stopped barking, even for a few seconds, by letting her out -- I gradually reduced this to about 1 minute of barking now til she remembers... she doesn't get out of the car til she stops barking. I tried corrections at one point -- startling her, then little leash 'pops' (jerks), hoping for an easy fix and to see if they would help at all. She did not care -- like many reactive dogs with poor self control, I think you could have throttled her and she'd have started barking as soon as you removed your hands form her neck.
So what did work with this frustrating behaviour?
Time, patience and positive rewards based training. This was such an eye opener for me about a whole philosophy of training -- it is truly 100 times more effective to get desired behaviours by motivating the dog to work towards your goal, not trying to scare the dog into conforming.