Is it legal to buy medicines online from the USA?
It depends on the answers to these 2 questions:
Are the medicines you want to buy controlled by the Drug Enforcement Agency (DEA)? (See the complete list at the DEA's website)
Do you have a prescription (given to you by a physician following a face-to-face medical evaluation)?
Ordering with a prescription in-hand:
If you have a valid prescription and want to buy non-controlled substances online then that is perfectly legal, from US-based or international online pharmacies.
If you have a valid prescription and want to buy controlled substances online within the US then from our best (non-legaly qualified) guesstimation that appears to be legal, but a bit academic as there are no legitimate online pharmacies which sell medicines controlled under federal law inside the US anymore. Ordering controlled medicines from outside the USA, even with a valid prescription, is illegal under the original Controlled Substances Act of 1970. (see 21 USC, Section 952)
Ordering without a prescription:
If you don't have a valid prescription and want to buy non-controlled substances online then if you buy from US-based online pharmacies you won't be breaking any laws, as far as we can tell. If you buy from a Canadian pharmacy the law makes generous provisions, but even if the pharmacy is located outside North America federal law is quite relaxed. Importing any prescription drugs (even non-controlled medicines) falls under the Federal Food, Drug, and Cosmetic Act, but the law specifically states that enforcement should be focused on cases in which the importation by an individual poses a threat to public health. Furthermore it says that discretion should be exercised to permit individuals to make such importations in circumstances in which the prescription drug or device imported does not appear to present an unreasonable risk to themselves. (See section J here)
The FDA's own guidance states: “FDA personnel may use their discretion to allow entry of shipments of violative FDA regulated products when the quantity and purpose are clearly for personal use, and the product does not present an unreasonable risk to the user. Even though all products that appear to be in violation of statutes administered by FDA are subject to refusal, FDA personnel may use their discretion to examine the background, risk, and purpose of the product before making a final decision. Although FDA may use discretion to allow admission of certain violative items, this should not be interpreted as a license to individuals to bring in such shipments.” (Source: FDA Regulatory Procedures Manual March 2010, Chapter 9 Import Operations And Actions, page 13. http://www.fda.gov/downloads/ICECI/C.../UCM074300.pdf )
Note also that the restricted definition of what is a valid prescription has only been changed by the law in relation to controlled substances. Therefore it could be argued that if an international online pharmacy issues you with a 'prescription' as part of the ordering process for a non-controlled substance then you would not be breaking any laws (see this quite complex legal article).
If you don't have a valid prescription and want to buy controlled substances online then you should be aware that according to the 'Ryan Haight Online Pharmacy Consumer Protection Act of 2008' that would be illegal. The new law is quite specific about what is, and what is not, considered a “valid prescription” in connection with controlled substances. In this case a valid prescription is one that you get from a physician following a face-to-face medical evaluation; any prescription obtained over the internet or telephone is not valid under this law. The law is mainly aimed at pharmacists, not their customers, and prosecutions of customers by the Department of Justice's DEA to-date have to our knowledge been few and far between, but you should be aware that you could be breaking the law if you order controlled substances over the web without a valid prescription.