I assume you are talking about taking drugs as opposed to the science of medicine, so I will answer the question that way.
Medicating is the treatment of a condition using drugs or potions in any form as opposed to surgery. A medication is any drug or potion in any form that is used to fight a disease or heal a condition. Medicine and medication, when discussing the use of drugs and potions, mean the same thing.
A prescription is a medication or medicine that is prescribed to you by a doctor which, generally, you cannot obtain legally without the doctor's written and signed prescription note. Medicines that can be legally obtained without a prescription are called "over-the-counter" medications (or drugs)", meaning anyone can go to the "store counter" and buy them without a pharmacist.
We can say "Did you take your medication?" or "Did you take your medicine?" and they will mean the same thing. If we are referring to a precription, we can also say "Did you take your prescription?" to be more specific.