Exercises, as Chris says, making sure you're properly hydrated, avoiding sitting still for too long and not moving about much generally for long periods. I find Magnesium supplements seem to have helped a bit.
I also find trying to relax the muscles can help, rather than tensing everything up trying to fight it. I know that probably sounds weird, but I read about it once and have tried it quite a few times and it has helped me. Then once it's settled enough, gently stretching.