Amazon.com founder and chief executive Jeffrey P. Bezos. (David Ryder/Getty Images)

The possible megamerger between pharmacy giant CVS Health and health insurer Aetna would be the biggest deal of the year if it goes through. It would also create a combined company less vulnerable to disruption by Amazon, the online retail giant that has been eyeing the pharmacy business.

Speculation that Amazon could get into the business of selling prescription drugs has sent tremors through the stock market since early October amid fears that Amazon would upend drug sales and distribution, as it did with bookstores and then bricks-and-mortar retail more broadly. (Amazon founder and chief executive Jeffrey P. Bezos owns The Washington Post.)

Every crumb of news about the company sets off intense speculation; one recent note from research analysts at Needham was simply titled “Fighting the Amazon Boogeyman in the Dark.”

Companies like CVS Health are seen as vulnerable on two fronts: An Amazon move into prescription drug sales could encroach on sales at CVS retail pharmacies, which already face strong competition. It could also threaten the big business of negotiating drug prices with pharmaceutical companies.

“The likely Amazon entry into retail pharmacy is a major threat to CVS, on top of already dwindling storefront sales,” Ana Gupte, an analyst at Leerink Partners, wrote in a research note.

CVS Health's bid to buy Aetna, first reported by the Wall Street Journal on Thursday, may be a defensive maneuver. Under that deal, CVS would become a health-care company that not only sells drugs and negotiates prices but also leverages its patient data to manage health-care costs. For example, a joint CVS-Aetna company could create health-care plans with low co-pays if people seek care at walk-in MinuteClinics to discourage more expensive visits to physicians' offices. It could use its regular contact with patients to get better insight into whether people with diabetes or high blood pressure were filing their prescriptions on time.

“The best way to build a moat around your business from Amazon is to go away from the businesses Amazon will compete with,” said George Hill, a research analyst at RBC Capital Markets.

There are other reasons for the Aetna-CVS deal, beyond building a defensive wall against Amazon.

CVS already faces greater competition in negotiating drug prices from the pharmacy benefit manager Optum, which is owned by the insurer UnitedHealth Group. Health insurer Anthem announced that it would launch its own in-house pharmacy benefit manager a few weeks ago, which included a five-year partnership with CVS. But Gupte said it had become clear that CVS needed to launch a strategic response to insurers that are moving toward running that business in-house.

Amazon is a wild card. It's unclear when or how the company will enter the market — or even if it ultimately will. An Amazon spokeswoman declined to comment about whether the company would join the pharmacy business. But several observers predicted that Amazon's path into health care would be trickier than its entry into other sectors — particularly in pharmacy's most lucrative areas, such as expensive specialty drugs.

“It’s a regulated market, which they’ve not done yet,” said Kevin Schulman, a professor of medicine at Duke University. “So at some level, in comparison to other markets, it's going to be slow for them to enter into this.”

The most immediate threat Amazon might pose is to the business of selling low-cost generics that consumers buy with cash. Since most people tend to buy drugs through insurance plans, guided by their benefit coverage rather than by the ease of shopping, Amazon will have to be strategic in forging partnerships or acquiring companies.

Although the prospect of competition from Amazon may have been a factor in the CVS-Aetna proposal, analysts said a more immediate concern for CVS may have been its stock price, which has dropped on speculation that Amazon might enter the industry. “I think what CVS needed to be as worried about as the risk to their actual business was the risk Amazon poses to their stock price — to the point where they lose the ability to do a transaction, lose the ability to control their own destiny,” Hill said.

Stefano Pessina, chief executive of pharmacy store chain Walgreens Boots Alliance, said this week that Amazon's possible entry was not changing his company's strategy. But he described a partnership with FedEx that would enable Walgreens stores to do more home deliveries to consumers.

“We will use this to create a fantastic network to deliver to the customers directly from our pharmacies,” Pessina said.

One of CVS's competitors in the drug price-negotiating business, Express Scripts Holding, saw potential in an Amazon move into the pharmacy market. The company suggested that its program that sells drugs to people who pay cash was safe from Amazon disruption and that it might even be interested in working together.

“If you look at the fox in the henhouse, first of all let me say, people have always worried about foxes and henhouses. And what I’d say is I think our henhouse is pretty good,” Timothy C. Wentworth, president of Express Scripts, said. When Walmart launched $4 generics, Wentworth recalled, companies feared that it would pose a threat to the business of pharmacy benefit managers, which negotiate drug prices on behalf of insurers. Instead, he said, Walmart's move turned into an opportunity for his industry, not the end.

He left open the possibility of a future partnership with Amazon. “We certainly see that as something where if they wanted to move into a space, we could be a very natural collaborator,” Wentworth said.

Read More:

Gilead’s $11.9 billion purchase of a groundbreaking cancer therapy could drag it into a new debate on prices

Pfizer sues Johnson & Johnson, alleging anticompetitive practices to maintain a drug monopoly