Shares of Pfizer and Merck fell on Wednesday after Wall Street analysts downgraded the drugmakers on increased competition and the pending loss of patent protection.

UBS slashed Pfizer's rating to neutral from buy on Wednesday, citing the so-called "patent cliff" in the coming years on key products that would greatly offset revenue growth. The bank also cut its 12-month price target for Pfizer to $46 from $48.5.

"Xeljanz, Ibrance, Xtandi, Eliquis and Tafamidis totalling $20 billion of sales (about 30 percent of total revenue in 2015) all lose patent protection from 2025 to 2029 and our valuation blend of discounted cash flow and price per earnings does not ignore this dynamic," UBS' pharmaceuticals analyst Navin Jacob said in a note.

BMO downgraded Merck to market perform from outperform, saying Wall Street's expectations for the drugmaker are too high given its over-dependence on the drug Keytruda. The bank kept its price target for Merck unchanged at $80.

"We've been Merck bulls because of Keytruda; however, the Street's Keytruda expectations are now meaningfully above ours, and seem to overlook competitive risks. We expect four to five competitor IO trial readouts in 2019 that have the potential to produce competitive results, and increase uncertainty," BMO's pharmaceuticals analyst Alex Arfaei said in a note.

Shares of Pfizer fell 1 percent to $41.95 in per-market trading on Wednesday, while Merck stock is down 1 percent to $75.15. Both companies outperformed the market last year as Pfizer returned more than 20 percent and Merck gained 35 percent.