I saw this dynamic with my son and his best friend when a new boy moved into the neighborhood. The new kid was trouble with a capital "T", and much more "fun" than my son who was not a boundary pusher. He wanted no part in doing things to get in trouble and what's worse is that his best friend's mom kind of believed that my son was part of the problem because that's what the other boys told her.
My son removed himself from the situation. Completely. It's not like he didn't have other friends. Funny this is, the FATHER came to my house a couple of months later and said that things had really changed since my son hadn't been around. Their son and the other boy had been in trouble for stealing, lying, vandalism......All things that had never happened before.
All I had to say was, "Well, one thing we know for sure is that my son was not involved in any of it".
My son was hurt, of course, that his friend ditched him. But, he ditched him for a jerk who got him in trouble. And, my son was not interested any longer in being the "good" influence. He had moved on.
I really believe my son got picked on because he didn't want to be a partner in crime, so to speak. Some boys, this age, don't want to go down in flames alone and my son turned out to be stronger than the little idiots who got themselves in big trouble. And...they had no one to turn on to try to get out of it except each other, which they both did.
I would document everything thrown, by video, if necessary, because if they break something, their parents can pay for it. You don't have to go hog-wild or get obsessive, but I'm a brat. I would go out and say, "You want to throw things at my house? Smile! You're on camera! You break something at my house...you're going to pay for it".
It's my experience that boys who act like that are full of false bravado. Especially at this age. Some of them act more like cavemen.
It doesn't excuse anything, of course, but I want you to know that my son wasn't really phased in the end by any of it. It was hard at the time, but he never had any desire to mend the relationship he'd once had with his friend.
He's a senior in high school now, has millions of good friends and is well on track for a career in law enforcement. They boys that gave him a bad time are still coddled by their parents and not on track for being successful.
It's not even about having the last laugh. It's about focusing on your own goals and moving forward. Not all parents will instill that, but as long as you do, your son will be fine.
Best wishes.