Some of the most popular prescription drugs that recently became available in generic form are sold at the lowest prices at Costco and at the highest prices at CVS Caremark, according to an analysis by Consumer Reports.

Failing to comparison shop for drugs - such as generic Lipitor to lower cholesterol or generic Plavix to thin the blood - could result in overpaying by $100 a month or even more, depending on the drug, the report said.

Related: ObamaCare weighs in: CVS tells employees to reveal personal health info -- or pay up

The article will be available in the May issue of Consumer Reports.

Consumers may find good deals at local independent pharmacies, Consumer Reports said.

One of the big takeaway messages from the analysis is that the customer must ask the pharmacist for the best price, the publication said.

"Especially for the independent pharmacies, if they want to retain your business and loyalty, they will help you get the best price," Lisa Gill, an editor at Consumer Reports, said.

One reason for the wild cost fluctuations may be that different types of stores have different business incentives, she said.

"It really comes down to a store's business model. For example, big box stores tend to use their pharmacies as a way to get consumers through the door with the expectation that they'll buy other things," Gill added.

Victor Curtis, senior vice president of pharmacy for Costco, said the retailer does not sell below costs and that its pharmacy is a contributor to Costco's overall profitability.

Consumer Reports conducted its analysis by using "secret shoppers" who called more than 200 pharmacies throughout the United States to get retail prices, without using insurance, on a month's supply of five blockbuster drugs that have recently become available as generics.

The drugs were diabetes drug Actos (pioglitazone); antidepressant Lexapro (escitalopram); cholesterol fighter Lipitor (atorvastatin); blood thinner Plavix (clopidogrel); and asthma drug Singulair (montelukast).

There was a difference of $749 between the highest and lowest priced stores.

For example, one month's supply of generic Lipitor costs $17 at Costco, Consumer Reports' secret shoppers found. The same drug cost $150 at CVS. Rite Aid and Target had similarly high prices.

Consumer reports recommends getting refills for 90 days instead of 30 days, as most pharmacies offer discounts on a 3 months' supply.