This is my biggest pet peve.

If no owner is around I yell at the top of my lungs for the dog to go home, get away, etc.. If the dog seems strong headed soemtimes I flail my arms portraying me as bigger person.
At the same time I try to pre-ocupy my dogs By giving them a leave it command or turn around & start to walk the other way. Raustyk can sometimes be dog aggressive so I really have to watch it with her. She can be strong when she wants to be good thing she is trained well.

If the owner is around I still do the same if the dog is not responding to the owner.

Then if the owner is around after (s)he gets control of her/his dog(s) I give them a piece of my mind.
I start polite just in case it was a one time incident where they accidently got loose. I explain that although their dog is friendly others may not be, and the dangers of getting hit by a car, someone stealing the dog, if its a small dog in the cuntry there are coyotes around etc... etc... If the owner becomes defensive I just get meaner. I'm usually a VERY nice person but not when it comes to this.
If it is an owner that does not seem to care or is mean to me or if it a re-uccuring thing I really let it loose. I get angry & tell them I'm sick of this happening and WILL call animal control everytime it happens from now on.

Sorry but I can't keep my mouth shut when a living creature has their life on the line.