The last thing in the world I would recommend is to take a painkiller. This will simply mask symptoms and does not cure anything. If your body is telling you something about its current state of ability or disability, I generally think it's a great idea to listen to it, rather than try to numb the issue, do stuff your body clearly does not want you doing, and end up in more pain. Not only that, but most painkillers have a host of other not-so-good effects on the body, none of which I feel is worth the temporary pain relief they might give you. There are many, many non-harmful ways to relieve pain, and I highly recommend turning to one of them first. It may be movement, mobility drills, acupuncture, an anti-inflammatory diet, some combination, or something beyond this.
This having been said, if you have joint or muscular pain, the last person I would usually send you to would be a Western medical doctor (and I am speaking as the daughter of two of them). Most doctors are not pain experts, and the suggestion you will almost always get is: "Take this (pill, shot, other pharmaceutical symptom-masker) and see this physical therapist." Most of the time, the physical therapy will not do much for the issue at hand, and the pill or shot will, at best, be a temporary panacea, and, at worst, make things much worse for you in the long term.
This is not a blog about how to get yourself out of pain, however-- the pain you have is a very individual thing, and will take assessment to determine the best route of action to relieve it. My point is, don't try to work through it if you have it. Listen to your body. This also goes if you are feeling ill or "feel a cold coming on" or something to that effect. If you're getting sick, your body does not need to use its energy up in the gym-- it needs that energy to help make you better. Plus, I don't know anyone in the gym who is going to benefit from catching what you're getting, so you're best off staying home and resting anyway.
I know this isn't the most useful blog if you're looking for ways to get out of pain (although I can absolutely help you with that, or refer you to someone who can, if you ask me privately). But I hope it will give you some food for thought as to how to approach such a situation.
Stay healthy, my friends.
Questions? Comments? Post 'em here!