There are currently three types of formulations which are in the market viz branded, branded generic and generic drug product.
The brand-name drug product is originally discovered and developed by a pharmaceutical company which is usually costlier due to cost involved in the process to bring it to the market and they are patented. Once the patent life expires on a brand-name drug product, it is eligible to be made into a “generic drug.”
Thus one can ask the pharmacy to substitute a generic drug for the drug prescribed by the doctor. However, a pharmacist may not substitute the generic if the doctor specifies that a brand name must be dispensed. Sometimes an acceptable generic is available that your doctor may not be aware of.
To read more info on Generic Vs Branded Medicine blog.