NSAID's (non-steroidal anti-inflammatory drugs) like ibuprofen or naproxen are best for muscle soreness, joint pain, and orthopedic injury. Ibuprofen (motrin, advil) is most used, but some people swear by naproxen (aleve). You want to take the lowest effective dose, usually 200-400mg of ibuprofen. When I was marathon training I started taking 200mg of ibuprofen before long runs, and it did seem to help me get through 3 hours of pavement pounding. Caveats for NSAIDs - they can irritate your stomach if you take them without food, and if you're on any blood-thinning meds, you shouldn't take them without consulting your doctor.
The best pain management is prevention. If you don't get to fly regularly, you should at least do lower back and hamstring stretches regularly. And have at least a minimum level of cardiovascular fitness and upper body strength. If you're going to sitfly, don't do an intense upper-body workout earlier that same day or even the day before (I speak from experience).
Hydrate, hydrate, hydrate. If it's a recirculator, the air is seriously dry.
Fly quietly, which means don't over-input your moves, and definitely don't slam your piece-partner around. Tunnel training is very good for teaching you to fly your own body through piece turns. If people are overly aggressive, there will be wall-slamming, and pain is a good teacher. If you're working intensively on something new, like piece turns with verticals, wear knee or elbow pads until you get so you can do them without slammage.
If you're very sore afterwards, evaluate why. Are you slamming each other around? Is there a large fall-rate discrepancy? The tunnel exaggerates this, so a girl who usually wears 10 pounds to fly with the guys will find that she needs to go up to 14 or 16. Whatever you are, be a good one.