Following much speculation, Amazon.com (AMZN) is finally taking on the U.S. pharmacy industry.

The only question now is just how far the company's healthcare ambitions extend.

Amazon announced on Thursday morning that it's buying PillPack, an online pharmacy that caters to consumers with multiple daily drug prescriptions. No terms were disclosed but TechCrunch reported that Amazon paid "just under $1 billion" for PillPack, which was valued at $361 million in a 2016 funding round. The deal is expected to close in the second half of 2018.

"PillPack's visionary team has a combination of deep pharmacy experience and a focus on technology," Amazon Worldwide Consumer chief Jeff Wilke said in the press release. "PillPack is meaningfully improving its customers' lives, and we want to help them continue making it easy for people to save time, simplify their lives, and feel healthier."

Not surprisingly, shares of pharmacy chains CVS (CVS) , Walgreens (WBA)  and Rite Aid (RAD) are down sharply. Various other healthcare service providers are also off. Walmart (WMT) , which was reportedly in talks to buy PillPack earlier this year, is down about 1%. Amazon, meanwhile, is up around 2%.

PillPack ships prescriptions to 49 out of 50 states (sorry, Hawaii), sorts and packages a customer's daily medications by the dose, and provides free shipping and automatic refills. On its site, the company notes that 40 million Americans take more than five prescriptions per day, and claims -- based on how likely customers are to recommend its service -- a customer satisfaction level well above the industry average.

Some obvious moves Amazon can now make include: Promoting PillPack's services to its huge U.S. customer base, using its fulfillment infrastructure to speed shipping times, leveraging its scale to negotiate better terms with drug suppliers, allowing customers to order refills via Alexa and offering discounts and/or other perks to Prime members.

One other potential move is building physical pharmacies inside of Whole Foods stores and integrating their services with PillPack's. For example, Amazon could let a customer place an order via PillPack and have it fulfilled through a Whole Foods pharmacy, or have an initial prescription handled by a Whole Foods pharmacy and refills shipped via PillPack.

There's clearly a big long-term payoff here, if Amazon can use its infrastructure, Prime service and potentially Whole Foods brick-and-mortar stores to take meaningful share from the likes of CVS, Walgreens and Walmart. Last year, research firm QuintilesIMS forecast that U.S. spending on prescription drugs will rise at a 4% to 7% compound annual rate through 2021, reaching a level of $580 billion to $610 billion. With the qualifier that healthcare is a space where regulatory and legislative risks are always present, an aging population of Baby Boomers positions the pharmacy industry to see healthy growth for years to come.

Will the PillPack deal be followed by an expansion into other healthcare-related fields? Some recent Amazon moves, such as the company's talks with hospital executives about becoming a medical product supplier to hospitals and its healthcare JV with JPMorgan Chase (JPM) and Berkshire Hathaway (BRK.A) , suggest its long-term ambitions in the space go beyond just pharmacy sales.

Amazon.com and JPMorgan Chase are holdings in Jim Cramer's Action Alerts PLUS member club. Want to be alerted before Jim Cramer buys or sells AMZN or JPM? Learn more now.

However, CNBC reported in April that Amazon has shelved its plans to become a drug supplier to hospitals due to logistics and other challenges (it still wants to sell "less sensitive" medical supplies to them, however). And from the looks of things, the JPMorgan/Berkshire JV aims to lower the costs of providing health benefits to the companies' employees (and perhaps eventually, the employees of other companies) primarily via technology investments and the use of negotiating power.

It's important to remember here that large swathes of the U.S. healthcare industry remain a minefield littered with middlemen, regulations, red tape, age-old business relationships and costly goods services for which buyers have limited leverage to wield against sellers. And that's an environment in which Amazon's existing retail, fulfillment and logistics strengths only get it so far.

In such an environment, going after the retail pharmacy industry with PillPack's help feels like low-hanging fruit -- a move that in many ways plays to Amazon's existing strengths, and carries relatively limited execution risk. The move could eventually be followed by attempts to go after other major healthcare markets, but don't be surprised if Amazon chooses to take its time.