In 2015, the US spent $328 billion on retail drugs, and another $129 billion on "non-retail" drugs,  which are the drugs purchased by hospitals, nursing homes, and other health care providers and added to your bill. The operation of  the market for prescription drugs is a tangle, in ways that suggest competition is often being hindered--or even throttled.

Matan C. Dabora, Namrata Turaga, and Kevin A. Schulman provide a useful diagram summarizing the US prescription drug market in their article, "Financing and Distribution of Pharmaceuticals
in the United States,' which appears in the May 15, 2017 issue of the Journal of the American Medical Association (pp. E1-E2).

The manufacturers of prescription drugs are at the center top of the figure. The drugs themselves work down the left-hand-side of the figure, through distributors and retailers, before reaching the patients. The various arrows in the center and right of the diagram show flows of payments, including AMP (Average Manufacturer Price), WAC (Wholesale Acquisition Cost), and then a maze of chargebacks, negotiated rebates, and payments from patients and private and public health insurance, often mediated through "pharmacy benefit managers."


In their short comment, Dabora, Turaga, and Schulman point out that there is a fairly high amount of concentration at a number of places in this market schematic (footnotes omitted):
"The US distributor market is highly consolidated, with 3 companies accounting for more than 85% of market share: AmerisourceBergen, Cardinal Health, and McKesson.The estimated combined revenues from drug distribution for these 3 firms in 2015 was $378 billion. ... 
"In 2015, an estimated 4.4 billion drug prescriptions were dispensed in the United States ... There are approximately 60 000 pharmacies in the United States, of which 38 000 are part of retail chains and 22 000 are independent pharmacies. The retail pharmacy market can be divided into 3 major categories: chain pharmacies and mass merchants with pharmacies, independent pharmacies, and mail-order pharmacies. The 15 largest firms, including CVS, Walgreens, Express Scripts, and Walmart, generated more than $270 billion in revenue in 2015 through retail and mail-order pharmacy, representing approximately 74% of retail prescription revenues.
"PBMs [pharmacy benefit managers] developed in the 1980s as employers added outpatient prescription drug coverage to their health insurance plans. By 2015, industry consolidation had resulted in 3 PBMs—CVS Caremark, Express Scripts, and UnitedHealth’s Optum—controlling a 73% share of the PBM market.
"Health insurance generally includes prescription drug insurance in both public and private health insurance plans. In 2015, 42%of prescription drug spending was from private health insurance, 30% from Medicare, 10% from Medicaid, and 14% from private out-of-pocket payments.
"In addition to the usual product discounts and allowances for product returns, manufacturers provide a series of cash payments to health plans, PBMs, and distributors in the form of rebates and chargebacks as a result of complex pricing arrangements across the industry. The end result of these complex transactions is that in 2015, $115 billion, or 27% of total pharmaceutical sales,was paid by manufacturers to various entities throughout the drug distribution and financing systems.

Aaron S. Kesselheim, Jerry Avorn, and Ameet Sarpatwari provided an overview of the research literature in "The High Cost of Prescription Drugs in the United States Origins and Prospects for Reform." which appeared in the Journal of the American Medical Association late last summer in the August 23/30, 2016, issue (pp. 859-871). They start with the basic facts that Americans spend more on prescription drugs that people in other countries, and that a number of popular brand-name drugs cost a lot more in the US than in other countries. Here's a figure on per capita spending on prescription drugs: 

On the topic of drug prices across countries, they write: "List prices for the top 20 highest-revenue-grossing drugswere on average 3 times greater in the United States than the United Kingdom. These disparities are reduced but remain substantial even after accounting for undisclosed discounts (“rebates”) that manufacturers offer to US payers. In 2010, estimated average postrebate prices for medications were 10% to 15% higher in the United States than in Canada, France,
and Germany (Table 1)."
Kesselheim, Avorn, and Sarpatwari sort through the research literature, looking for a potential reasons for these high levels of drug prices and drug spending. My own list of some of the reasons from their article would look like this: 

1) Prices are rising for brand-name drugs, and competition between brand-name drugs doesn't seem to bring down prices. 

"Although brand-name drugs comprise only 10% of all dispensed prescriptions in the United States, they account for 72% of drug spending. Between 2008 and 2015, prices for the most commonly used brand-name drugs increased 164%, far in excess of the consumer price index (12%). The annual cost of a growing number of “specialty drugs”—high-cost, often injectable biologic medications such as eculizumab (Soliris), pralatrexate (Folotyn), and elosulfase alfa (Vimizim)—exceeds $250 000 per patient. ...
"In practice, however, competition between 2 or more brandname manufacturers selling drugs in the same class does not usually result in substantial price reductions. For example, of the 8 cholesterol-lowering statins that the FDA has approved, 2 have until recently remained patented: rosuvastatin (Crestor) and pitavastatin (Livalo). Despite the similar performance of these drugs in decreasing low-density lipoprotein cholesterol to other off-patent statins, the price of rosuvastatin increased 91% between 2007 and 2012, from $112 to $214 per prescription.  During the same time, the price of the comparably effective atorvastatin decreased from $127 to $26 per prescription owing to the expiration of its patent protection in 2011. Similar effects have been observed for other drug classes."

2) While competition from generic drugs often does help to bring down prices, that competition faces a number of limits. Brand-name manufacturers often find ways to push back competition from generics, and when a generic for a relatively rare condition has a monopoly, the price for the generic skyrockets, too. 

"The only form of competition that consistently and substantially decreases prescription drug prices occurs with the availability of generic drugs,which emerge after the monopoly period ends.With FDA approval, these products can be substituted for bioequivalent brand-name drugs by the pharmacist under state drug product selection laws.In states with less restrictive drug product selection laws, generic products comprise up to 90% of a drug’s sales within a year after full generic entry. Drug prices decline to approximately 55% of brand-name drug prices with 2 generic manufacturers making the product, 33% with 5 manufacturers, and 13% with 15
manufacturers. In 2012, the US Government Accountability Office estimated that generic drugs accounted for approximately 86% of all filled prescriptions and saved the US health care system $1 trillion during the previous decade. ...
"Entry of generic drugs into the market, however, is often delayed. For pharmaceutical manufacturers, “product life-cycle management” involves preventing generic competition and maintaining high prices by extending a drug’s market exclusivity. This can be achieved by obtaining additional patents on other aspects of a drug, including its coating, salt moiety, formulation, and method of administration. ... For their part, generic manufacturers have engaged in litigation with brand-name manufacturers that could lead to the patents being invalidated, but these suits are frequently settled. Historically, brand-name manufacturers have offered substantial financial inducements as part of these settlements to generic manufacturers to delay or even abort generic introduction. Settlements involving large cash transfers are called “pay for delay”; for example, in a patent challenge case related to the antibiotic ciprofloxacin (Cipro), the potential generic manufacturer received upfront and quarterly payments totaling $398 million as part of the settlement and agreed to wait until patent expiration to market its product.
"Although brand-name drugs account for the greatest increase in prescription drug expenditures, another area that has captured the attention of the public and of policy makers has been the sharp increase in the costs of some older generic drugs. In 2015, Turing Pharmaceuticals raised the price of pyrimethamine (Daraprim), a 63-year-old treatment for toxoplasmosis, by 5500%, from $13.50 to $750 a pill. The company was able to set the high price despite the absence of any patent protection because no other competing manufacturer was licensed to market the drug in the United States.
Significant increases in the prices of other older drugs include isoproterenol (2500%), nitroprusside (1700%), and digoxin (637%). Even though the prices of most generic drug products have remained
stable between 2008 and 2015, those of almost 400 (approximately 2% of the sample investigated) increased by more than 1000%. ...
3) The big government purchasers of drugs, Medicare and Medicaid face legislative limits in encouraging or requiring the purchase of cheaper drugs or generic drugs.
"Medicare, for example, accounts for 29% of the nation’s prescription drug expenditure, but federal law prevents it from leveraging its considerable purchasing power to secure lower drug prices while requiring it to provide broad coverage, including all products in some therapeutic categories, such as oncology. Based in part on considerable lobbying and arguments that government negotiating power could decrease revenues for the pharmaceutical industry, Congress included a provision in the law that created the Medicare drug benefit program, prohibiting the Centers for Medicare & Medicaid Services from negotiating drug prices or from interfering with negotiations between individual Part D vendors and drug companies. ...
"Similarly, state Medicaid programs are generally required by law to cover all FDA-approved drugs, even if a particular medication has alternatives that are safer, are more effective, or offer greater economic value. However, Medicaid is also entitled to receive a rebate of at least 23.1%of the average manufacturer price for most branded medications and is protected from price increases exceeding inflation.
4) Prescription benefit managers are typically paid according to the total revenues of the drugs they manage, and thus lack a strong incentive to negotiate for lower prices. 
"In the 1990s, prescription benefit management companies became prominent intermediaries whose role would be to help employers or insurers promote appropriate prescription drug use and decrease its cost. There have been some recent isolated examples in which pharmacy benefit managers have doneso for specific drugs (most prominently for drugs treating hepatitis C or the pro-protein convertase subtilisin/kexin type 9 inhibitors to reduce cholesterol levels). However, aggressive price negotiation is not the norm. This is not surprising because part of pharmacy benefit managers’ annual fees are based on a given payer’s spending on drugs. Although the details of such payments are rarely disclosed, when one of the largest pharmacy benefit managers became a publicly traded entity, it was obliged to disclose its business model, much of which depended on payments from drug makers for shifting market share to their products from others in its class."
5) State-level  laws also tend to protect brand-name drugs by hindering competition from generics. 
"Notwithstanding high generic drug use rates, problems at the state level can diminish the capacity of generic drugs to help contain costs. Thirty states have drug product selection laws that allow but do not require pharmacists to perform generic substitution; in 26 states, pharmacists must secure patient consent before substituting a generic version of the same molecule. The latter obligation was estimated to have cost Medicaid $19.8 million in 2006 for simvastatin (Zocor) alone. In addition, all states allow physicians to issue dispense-as-written prescriptions that pharmacists cannot substitute with a generic product, further contributing to hundreds of millions of dollars in spending on branded drugs for which generic versions are available."
6) Large self-insured employers have traditionally felt that the potential cost savings from negotiating hard over drug prices, or pushing for alternative and cheaper drugs, wasn't worth the risk of bad public relations episode.
"Even large, self-insured employers have avoided aggressive attempts to negotiate prices directly with drug suppliers or to curtail their formularies to avoid paying for prescriptions that are less cost effective.  A common reason for this reluctance is that because pharmacy benefits have traditionally comprised less than 15% of health
care budgets, the organizational concern that could be caused by denying payment to an employee or retiree for a particular drug was  seen as overwhelming the modest savings that could be realized. This may change as drug prices increase, particularly for widely used products, and as drug spending consumes a greater share of health budgets."
Overall, the consequences of this lack of competition contribute to high and rising prescription drug prices. One tradeoff is less money in household and government budgets to spend on other priorities. Another tradeoff is that people facing high drug costs become less likely to take the drugs on time and in full, which leads to preventable health problems.

There is also a potential tradeoff between cheaper drugs today and incentives for innovation leading to the new and improved drugs for the future. There are a variety of ways to provide additional incentives for innovation, including more government support or tax incentives for R&D, and reform of the Food and Drug Administration protocols so that testing and bringing a new drug to market is not so difficult and costly. In comparison, having drug companies that seek out generic drugs where they can be the sole producer and then jack up the price doesn't seem an especially useful incentive.  
There's an solid economic case for patents and intellectual property, which offer some protection from competition, but whether it's drugs or some other product, the case for patents doesn't imply that the remaining competitive forces should be stripped out of broad areas of the market.