Since I have had to live with crazy pretty much anyone who has wanted to be even a semi-permanent part of my life has had to deal with it too. I known people who have dealt with it well. I have known with people who couldn't deal with it at all. The best ones, though, are the ones who don't deal with it at all, but deal with me instead and help me come through it as unscathed as possible.
So, how does one do that, should one encounter someone suffering from crazy? After years and years of research I think I have come up with a short list that may help...
1. Never assume it is about you. It isn't. It's crazy. Even if the person in question is going on and on about how their life sucks, and you are a big part of that life, it STILL has nothing to do with you. Trying to determine what role you play in causing the crazy, or how it is affecting your relationship is for later, not in the moment. In the moment it will just make the crazy person crazier because they will assume they have hurt your feelings, or that you hate them. Both are rocket fuel for crazy.
2. Don't try to force them to stop being crazy. If they could stop the crazy, they would. Telling them are being embarrassing, or unreasonable, or ridiculous, or that they just need to "knock it off" will just reinforce the thoughts they are already having, and prolong the crazy.
3. If you are worried about saying the wrong thing, don't say anything. You never know what a person in the middle of crazy is going to take the wrong way. Sometimes just being there, and letting them know you aren't leaving is the best thing you can do.
4. Let them cry. Sometimes it is the best thing to wash all the crazy away.
5. Let them know you still see them through the crazy. This is the big one, and the best way to make crazy go away fast. Let them know, in any way you can, that this is temporary, that it is something they are dealing with, and not who they are.
There are other little things to do, like making sure they have taken their meds, telling stupid jokes, eating carbs, and making sure they are cool with the term "crazy" before using it (I, myself, have embraced it), but those are the big five.
Oh, and when all else fails, remember, this is someone you care for, crazy or not. Fall back on that to guide your actions, and everything should be okay.