I really think that dealing with downswings is one of the keys to being a successful poker player, certainly in cash games. I play limit mainly, and have just come out of two 100BBish downswings. After my 5th big losing session in a row I had to really figure out whether I had suddenly started to play badly or was just being unlucky. But, when your flush draws just don"t come in and you see set over set and your full house is beaten by rivered quads, well, there"s not much you can do.
Personally, I remind myself that - in my view - winning money is the easy part. After all, when you"ve got the nuts you just try to get as much money in as possible, or something similar. The difficult bit is losing as little as possible when you can"t catch a hand, as hi_am_chris says. This is always difficult, but, on a downswing, it"s especially hard to remain disciplined. And if everybody"s losing at the table, but you lose less than the others, well, you"re still a winner.
Some people recommend taking time off the game; I like to read Krieger"s Hold "Em Excellence books, which I think are especially handy on the mental side of the game. Almost every book tells you about tactics and the like, but mental attitude when things are going badly is crucial.
Lastly, I like to think of the odds. The chances of getting the right cards in the right position are so-and-so, the chances of them hitting the flop are so-and-so...and I realise that winning a hand, in limit, at least, can be rare, so, again, it comes down to minimising the losses in between those occasions. On the upside, though, there is a small chance of winning three hands in a row, and, if I play long enough, it will happen...
...and smile when they get their one-outer, say "nice hand", and repeat inwardly "1 in 46 chance, mate, the other 45 times I"m taking your money"! Keep tight, play well and you"ll pull out.