I'm not sure it's illegal per se. What I do know, is it can often be confiscated due to intellectual property mumbo-jumbo. Which I guess is still a legal issue, but the illegal act would be more on the seller's side, not yours. I'm not a lawyer, so ask your local neighborhood lawyer what he/she thinks.
My mom has asthma and takes Advair. I'd have to ask her how much it cost, but I think it cost over $100 for a 30 day supply (a quick google of prices shows $270 as the lowest price for 60 doses, at two doses a day that'd last 30 days). She was trying to stretch out her medication and was only taking one dose a day, then one dose every so often. Not that good for her.
She can buy some from an overseas pharmacy and pay $75 for 60 doses of the the exact same medication (fluticasone propionate 250 mcg and salmeterol 50 mcg). That went so well she made another order of a generic version. This one has half the salmeterol (fluticasone propionate 250 mcg and salmeterol 25 mcg), a total of 240 doses cost about $75.
Ordering overseas is so much cheaper, she could get an entire year's supply for less than a 30 day supply would cost. She's still stretching the doses out (one dose a day instead of two), but she doesn't have to anymore.
I've imported quite a bit of medicine, though a lot is coming FROM the US (currently in Australia). Things like tylenol, ibuprofen, and melatonin (melatonin, the real stuff, is crazy expensive here vs dirt cheap in the US). I've also ordered things like propranolol (blood pressure) and glyburide. Funny story, if you have gestational diabetes (as my wife did), the first medication doctors prescribe in the US is glyburide; the mere idea of that freaks out Australian doctors. Hence us ordering it from overseas.
Now, I'm not recommending anyone order from an online pharmacy, just in case it's illegal/dangerous/whatever. In fact, I'll say DON'T DO IT! Cause it might be illegal and dangerous. Even though all the reports of counterfeit medicine I've read were issues with the whole supply (and not for specific pharmacies), and the fact that counterfeit medicine included things such as "right active ingredient, but passed off as name-brand" (like labeling Equate ibuprofen as Motrin; same active ingredient, but not name-brand). So for legal purposes I'm saying "Don't buy cheap medicine from overseas countries! Do as I say, not as I do!"