If I'm getting too mad for me to control myself, the best thing you can do is let it happen.
Whatever you do, don't attempt to apply some sort of reprimand while it's in progress, certainly not one stemming from letting my madness make you mad as well.
Don't try to psychoanalyze it, don't tell me I'm doing anything wrong, don't tell me I'm getting mad at something minor. Any of those things will just make the problem worse, or even reignite it if it's seeming to subside.
Human emotion, by definition, is not rational. So why do we need to make it seem rational? Why do I need to be mad at anything in particular?
Why do I need to become something inhuman? When I get mad, I end up mad at myself for being mad, and then I end up mad at myself for caring whether or not I'm mad or expressing it in a certain way. I'd be a thousand times less mad if I was just allowed to be mad.
(99% of the time, you can get along with me fine, although being friendly or striking up a conversation or even trying to interact with me in any way that's not mandated in some way is not going to work and it's going to be counterproductive. But if you don't take some tidbits away for the other 1% and then label me as a monster - or even seek to reduce that 1% by not lighting the match in the first place - it's your own damn loss.)