Free delivery. A membership fee. It's not Amazon Prime, though it sounds like it.

CVS is piloting a program in Boston that includes free delivery on most prescriptions and online purchases, access to a pharmacist helpline, a 20 percent discount on all CVS-branded products and a monthly $10 coupon. Called CarePass, a membership costs $48 annually or $5 monthly, less than half the price of a Prime membership.

Though still just a pilot in one city at this point, CarePass is a bold attempt to fight Amazon — and may even put the retailer ahead. CarePass bundles prescription drug delivery with everyday items — something Amazon doesn't yet do.

"We think it's a one-of-a-kind in the marketplace, but the reason for doing it is the direct response of the interest that our customers have shown us in the program," CVS Pharmacy President Kevin Hourican told CNBC.

Online shopping has already hurt drugstores' revenue as fewer consumers come in to buy everyday items. Amazon acquired online pharmacy start-up PillPack this year, a move seen as a major threat to pharmacies because it immediately gives the e-commerce giant a way into the prescription drug business.

Pharmacy chains have started shuffling their businesses. CVS and Walgreens are pulling some products and dedicating more space to health services. CVS is acquiring health insurer Aetna for $69 billion, a deal it expects to close this quarter.

Yet sales in the front of the store, excluding retail pharmacy, still represent about $20 billion of CVS' total $184.77 billion in revenue. And the company says its retail business helps introduce customers to CVS and encourages them to stay within the company's ecosystem once they start filling prescriptions.

Right now, CVS knows customers are shopping elsewhere for the products it sells, Hourican said. It wants to change that. With the membership program, the hope is people will shop at CVS instead of other retailers, shop more often and shop in more parts of the store than they currently are.

The pilot program is live in more than 350 stores in the Boston area. There, CVS will tinker with the program to see what resonates with customers. A future iteration could include a MinuteClinic offering, among other possibilities.

"We want this to expand nationwide," Hourican said. "But we also want to make sure we are ready and prepared and that when we do roll it out nationwide, the program is one that customers can have a great experience with."