I have a condition that requires the amount of the drug in my blood levels to remain very consistent. Because of that, I've never trusted generics--the FDA allows 80% to 120% of active ingredient which is too much of a swing. I don't doubt that some (maybe even most) have anywhere close to that range anyway (read: "Bottle of Lies" by Katherine Eban.) The brand name for my drug is $998 a month in the US. I can get the brand name from an online Canadian Pharmacy for $123.62. Supposedly you are only allowed 90 days worth, but this is a gray area that isn't really cracked down on. I found a legit, certified online pharmacy and haven't experienced any issues so far.
Here in the US, there is an online pharmacy, Valisure, that chemically tests all the drugs it sells. This is the online pharmacy that sounded the alarm about NDMA being detected in Zantac. The company was founded by two guys from Yale after one of them suffered complications due to the wrong amount of active ingredient in his anti-convulsant medication. I haven't tried them yet, but if I'm no longer able to purchase my prescription from Canada I plan to try their chemically tested generic version. (They don't make the drugs, it's the same suppliers as all pharmacies, but they crush up and test all batches for accuracy and quality before selling).
Something needs to happen here in the US to make drugs more affordable, and generics aren't the answer due to quality concerns.