Let me clarify. The drug does not need to be AB rated to substitute, but therapeutically equivalent (same generic) as determined by the pharmacist's professional opinion. This might be different depending on your state. From my state's Board of Pharmacy:
"2)Except as limited by subsections (3) and (5) of this section, unless the purchaser instructs otherwise, a pharmacist may substitute as follows:
(a)A drug product with the same generic name in the same strength, quantity, dose and dosage form as the prescribed drug which is, in the pharmacists professional opinion, therapeutically equivalent.
(b)When the prescriber is not reasonably available for consultation and the prescribed drug does not utilize a unique delivery system technology, an oral tablet, capsule or liquid form of the prescribed drug so long as the form dispensed or administered has the same strength, dose and dose schedule and is therapeutically equivalent to the drug prescribed."