I think you need to be able to spot the abuse early and then cut it off. Not participate. Even if you have to leave. Tell him that your marriage is not falling apart. That it is fine. Tell him that you will talk to him when he is himself again. You must not tolerate the abuse.
Also talk to him (when he is normal) and ask what triggers the start of his though patterns when he gets like this.
Is he in therapy? It sounds like he should be. Cognitive Behavioural Therapy
seems to be a good choice for this kind of problem.
But what does your therapist say? I am in no way an expert in this. For the last six months I have been trying to help a friend with her abuse problems but they are pretty extreme.