I find that in my case, playing the mental game right becomes the most important thing as episodes grind on. Particularly at night. I don't know how chronic people do this.
I steal a lot from zen teachers and competitors in precision sports for mindset, and play small attention games if I can manage it. Music with polyrhythms is a useful one, but I was a drummer as a kid and trying to tap along is familiar (and more importantly, each song I can make it through kills a few minutes).
Anything to focus on is better than sitting there and taking a beating. Because you're right, that's when you start to ruminate. I try to keep my mind on a very short leash and frame getting through it as just another distasteful and necessary job.