The expiration date on both prescription and non-prescription medications signifies its full potency up until that date. However, this does not mean that drugs past this expiration date are necessarily unsafe to use or are spoiled. Many studies and tests have been conducted on the effectiveness and side effects of using expired drugs in the last fifty years. The only case that has shown detrimental results has been the drug tetracycline causing damage to kidneys reported in the early 1960's, due to chemical changes in the drug.
But before popping a pill that's been around longer than you have, keep in mind that liquid medications and medications that have been stored in a warm, moist environment degrade more quickly than solid medications that are stored in a cool dry place. If you do decide to take an expired drug, take a good look at it to make sure there are no visible changes in the drug such as clumping, discoloration, or odors. Liquids should stay clear if they came that way, and the consistency should remain the same (i.e. no separated layers or cloudiness). Additionally, if your life is dependent on a certain dosage, strength, or formulation of a drug (such as heart or blood medicine), you should keep your prescriptions current and pop the expired pills straight into the trash can.
Based on the guidelines described above, you should be ok if you took recently expired Xanax, an anti-anxiety drug that comes in a hard pill form. Though expired, hard pills degrade very slowly and should retain most of their original potency. If your condition requires a full dosage of the drug, then you should visit your health care provider, who can reassess your case and renew your prescription or prescribe new drugs as she/he feels is necessary. It's never a bad idea to get an up-to-date prescription if you still need the medication — there is a general recommendation to toss expired medications, regardless of the form. This is for your safety.
All of that being said, use your own judgment and perhaps give a call to your pharmacist or health care provider. Always use your best judgement, and you take care! :-)