Well done, Wolfy. You should feel more than a little pride for what you did -- it takes courage and self-respect to do that.
My first thought was "Talk to the person at your school who deals with bullying, etc."
My second thought was a bit different: what these kids did is pack behavior -- if it'd been just one or two of them, they may well not have yelled at your friend. In a group like that, one of them is the alpha, and I'm guessing you know which one. How about talking to that kid one-on-one, in a friendly way, and explaining why it's not cool to act like that? If you can convince that one, they may well have enough influence over the others to nip that stuff in the bud another time.
Yeah, it would take some nerve, but you've shown you have that. I'd give it a try, and keep talking to the authorities as your backup plan.
In the meantime, if you encounter them again in a group, "Just ignore them" is good advice.
Oh, and -- yeah, you're a GREAT friend.