This is just what I do based on my experience with this type of situation, and overall very general. I can try and be more specific with more information, but until I get some, this will have to be a start.
The first thing I would do, in this situation, is identify whether he's doing this out of fear or not and overall what kind of horse he is. For example, is he a dominant horse, or a more timid one? Knowing how he reacts to things and thinks will definitely help. Also, is it possible to separate him from the other horses completely? As in, not turned out with them, etc?
If he's doing it because he's afraid, that will change your approach- for instance, you probably don't want to smack him with your reins when he doesn't listen or use harsh punishment because that will make the situation worse, the last thing you want to do with a horse that rears. It will just make him even more afraid, which is, in my opinion, incredibly dangerous. But, if he's just doing it because he can, a good thump on the shoulder may be necessary if he's not listening to your other aids when you ask him to go away from the other horses.
My next question is how well does he listen to your aids when he's throwing a fit? Can you, say, still turn him? Do you need to use your reins to pull, or is he listening enough to your seat? Or do you completely lose control?
I don't know anything specific about your situation, but there are two different general
approaches that I find work best for this problem- the first is a slow and steady weaning of the horse from the company of others, which usually is best for a horse that is just timid by themselves and is more afraid than anything. Going out for long trail rides with other horses and slowly cutting back on how many go out with you is a good start, and increasing the distance between him and the other horse(s) on the trails at first. Try to get down to one horse, who is preferably a very calm, independent trail horse who doesn't care about him at all. When out with the other horses on a trail ride, work on doing little circles/ listening to your aids/etc while the other horses walk on. Start with little things, even the slightest instance of choosing you over the other horses/ his anxiety gets praise. Eventually you'll be trying to get him to listen to your aids despite being anxious while the other horses get farther away, and slowly ask more and more. Maybe ask for him to stop and disengage his hindquarters, or back a few steps. praise when he does it calmly and well.
Then you can start riding out alone, and when he starts to really get worked up, at that point where he hits "the wall," either make him stand still while you're in the saddle, or get off and stand with him if you have to. The minute he relaxes or shows any kind of submission to you, praise him and turn around. If he gets worked up again while walking back to the other horses, rears, anything, he stops, turns around, and has to stand and relax again. Work up to walking him past that spot, and then eventually riding, and gradually increase the distance. Basically, you're forcing him to realize that it's not the end of the world, and getting him to relax and realize that he's okay by himself.
The other method, the one I use with my horse, is a more strict approach for horses that are just being rude and not listening. My horse isn't afraid to be by himself, he's just a very pushy horse that likes to see if he can get away with things and, if he can, doesn't hesitate to do so. He needs a very firm hand, not all the time but once in a while he does need a quick reminder that I'm boss. He's perfectly fine out alone but he has some sticky spots on our little loop. For instance, I ride straight down a road to get to the fields by my house where I ride, and he's fine walking down it because my neighbor's horses kind of distract him, but the second I ask him to turn to the left or right, away from both our house and the neighbor's horses, he throws a tantrum which consists of turning around and trying to take off home. When he turns, I put my leg on and pull the rein around, so that he has to keep turning until he's facing where I want to go again. I keep doing this until he stops turning and trying to bolt, although sometimes it gets to the point where I have to use my reins and give him a smack. This always snaps him out of it and we go on our merry way, with some other little tantrums depending on how long it's been since I last rode him. Basically, this is just a heavier handed way of dealing with it for horses that are more strong willed and like to step on you when you're not firm enough. Try to be patient- I've had to do circles with him for up to twenty minutes before he would continue on. He would turn at the same spot, I'd pull him around, make him stop, ask him to go forward, and repeat. Stay calm and don't get worked up, and don't be afraid to pop him in the shoulder if you feel he's getting out of hand.
These aren't the end-all-be-all, they're VERY general, and according to the horse will be changed accordingly. My sister's mare, for instance, is neither scared nor capable of dealing with tough love. If I tried to smack her, whether she was misbehaving out of pure disrespect or actual fear, her mind would go off and things would escalate. She needs a gentle, constant push and lots of pats on the back to make her feel good about herself. My arabian, on the other hand, is a giant baby and thrives on love. He needs more positive reinforcement than anything, with very, very little negative reinforcement. Lemme know if anything here isn't clear, at this point I'm not even checking what I've written, it's too much for me to re-read, lol.