As companies throughout the universe of the health care industry accelerate the pace of consolidation, two of the country’s biggest drugstore chains have agreed to combine to create a new giant.

Walgreens Boots Alliance said on Tuesday that it would buy Rite Aid for more than $9.4 billion in cash, significantly bolstering its influence with drug makers and pharmacy benefit managers.

But the combination may draw a skeptical eye from government regulators concerned about the retail pharmacy market effectively shrinking to only a few big chains.

The deal is the latest taking place in the sweeping changes under the Affordable Care Act, which has inspired drug makers, insurers and others to combine.