I've blasted a few with the Halt brand spray I cary, and it's always worked for me when I was able to anticipate the situation, and get ready. Otherwise, I just sprint, but the shouted command thing sounds like it may be worth a try (as an embellishment to sprinting, NOT as a substitute).
Many years ago, I got chased by a "pack" when cycling through a rural NY town. I didn't go for the Halt, and tried to outsprint them (I may have panicked because there were so many of them). I was having a tough time as I was packing 90+ pounds of gear at the time (excuse). Just when I thought the leader was going to get me, the whole pack turned, and began running away with what seemed like even more determination. That's when I saw they were being chased by what looked like a large white Siberian Husky. After driving them about 50 yards away, he turned back toward me, and since he approached in a non threatning manner, I let him come up alongside me. When last seen, the pack was heading for the next county at a high rate of speed. He trotted alongside me for the next mile or so until we cleared the town, so I pulled over and stopped and he did the same. There were no PowerBars back then, so I broke out one of the peanut butter and jelly sandwiches I was carying, and shared it with him. When I got up to leave he just sat there until I was a down the road a bit, then he headed back toward the town. I got the impression that he was failiar with this drill, possibly protecting his cyclist owner from similar onslaughts in the past. What a dog!
John