While startups like Uber and Snapchat have garnered giant valuations recently, another sector looks like it might be getting just as overheated.

Big pharma firms and investors have been showering billions on speculative companies that have never produced a viable drug. For four years running, biotech stocks have risen faster than any other sector of the market in the United States. Health care set new records last year for both IPOs and M&A spending.

The reason is that with their existing patents expiring and the cost of R&D climbing, many global drug companies are desperate for new ideas. Cheap debt, a frenzy of publicity for research that hasn’t yet led to any products, and obscenely high pricing for the medicines that make a difference are all adding fuel to the fire.

The risk of this is that valuations could keep spiraling higher—until they come crashing back down, either because campaigns to lower drug prices succeed, or because too many of the hoped-for new drugs turn out to be duds. That could set scientists and investors back years, and deny life-saving treatments to suffering patients.

The biotech sector is exploding by almost every measure

Private biotech funding still isn’t as big as regular tech (i.e., internet and software) in dollar terms. Software companies raised $19 billion of venture capital in 2014; biotech and medical-device companies raised $8.6 billion, according to a report from PwC. Similarly, tech IPOs raised more money in 2014 than biotech ones—even when you subtract the year’s record-setting Alibaba IPO. And the amount raised by biotech IPOs increased only slightly from 2013 to 2014.

However, in the number of IPOs, biotech is exploding. There were 102 health-care IPOs in the United States alone in 2014, 71 of which were biotechs—one in four of all US IPOs. That easily crushes the 2013 record of 55 health-care IPOs (of which 47 were biotech), and is far more than at the height of the early 2000s genomics bubble, in which many startups went public, soared in value, then crashed.

The average return on last year’s biotech IPOs was 13% on the first day, and 21% through the end of the year. That made them by far the best-performing segment of the IPO market. In December, half of all IPO filings in were biotechs, according to Renaissance Capital, a manager of IPO-focused exchange-traded funds.

Tech companies have been criticized for burning through cash, acquiring other companies just for their engineering talent, and spawning the term “pre-revenue” as a euphemism for not making any money. But at least by the time they go public, they have a revenue stream. According to J.P. Morgan, most of the biotech companies that have gone public in the last two years have done so with either ”preclinical assets”—i.e., drugs that haven’t yet been tested on people—or with drugs in phase 1 or 2, the smallest, earliest, and most fraught stages of human trials:

To give a sense of how precarious that is, according to one survey (pdf) of leading drug companies, 97% of drugs in preclinical tests never make it to market, and nor do 95% of the molecules in phase 1 clinical trials and 88% of molecules in phase 2. Not until phase 3 do their prospects get much better: Of the ones that make it that far, 56% are approved.

That hasn’t stopped companies in these stages from reaching huge valuations. Juno Therapeutics raised $300 million in its in its December IPO (paywall), and is valued at $4.5 billion. Kite Pharma is worth $3 billion after debuting last year. And bluebird bio’s stock has tripled based on its experimental techniques for changing faulty genes. Spark Therapeutics, a “pre-revenue” company that is developing gene therapy treatments for rare diseases, went public in late January and is worth more than a billion dollars.

The sector’s overall stock-market performance has been extraordinary too. Last year, Nasdaq’s biotech index outperformed the broader market by 60%. Last July, Federal Reserve chair Janet Yellen took the rare step of singling out small-cap biotech stocks (as well as social-media stocks), describing their valuations as “substantially overstretched” (paywall). Since then, they’ve kept growing considerably faster than the rest of the market:

Last year was also record breaking for M&A. There were $379.5 billion (pdf) of deals throughout the pharma, biotech, and medical sectors, compared to $173.7 billion in 2013. There were also $224.1 billion in lapsed deals that didn’t quite make it to the finish line.

Investors are betting on untested business models

The biotech craze isn’t, of course, built entirely on hot air. There was a jump in drug approvals last year, there are some potentially revolutionary drugs in development, and the US Food and Drug Administration (FDA) opened up a few ways of getting promising drugs approved faster. Biotech saw its first true blockbuster for some time in Gilead’s Hepatitis C drug Sovaldi, which was approved in late 2013, and quickly set sales records. Companies that have products on the market and are growing their revenues may warrant their high valuations.

But others do not. According to Morningstar biotech analyst Karen Andersen, while some companies are still undervalued, a growing number have valuations that basically assume that the drugs in their pipeline will be successes. In reality, though, bringing a drug to market is one of the most expensive and difficult things in business.

“We give firms more credit for early-stage programs than we ever have,” Andersen says. “I’m not sure how much more credit we can extend, without it becoming purely theoretical.”

Last year, admittedly, some deals were attempts at tax inversions, where an American company acquires a a foreign business in order to move its tax domicile overseas and get a lower corporate tax rate. Analysts expect fewer of those this year, after the Obama administration implemented rules making the deals less attractive.

But the appetite for early-stage companies will continue. That demand is coming from both pharma companies and now the larger biotech firms, says S&P lead health care analyst Kevin Loo. “You are going to see a continuation of acquisition of small cap development just to fill in the pipeline.”

“Most of the large cap biotechs are flush with cash, and debt is still cheap,” Andersen concurs. “So they can afford to pay full price, particularly if they are trying to cobble together a complete regimen for say, cancer or hepatitis C. And some of the firms that have had very strong double-digit growth recently will need to make acquisitions that move the meter, in order to maintain strong growth.”

In short, the market frenzy is likely to continue or even intensify. When investors see that a company like Gilead added more than $100 billion to its market cap in three years based almost entirely on one acquisition and one drug, it makes them bullish on both the industry and further acquisitions.

Much of the current frenzy is focused on a particularly risky subset of treatments.

CAR T-cell therapy, for example, genetically engineers the body’s own immune cells to attack tumors. It has shown the potential to rapidly eliminate some cancers. But the problem—besides the fact that it could cost $300,000 or more per patient for a one time treatment—is preventing the cells from attacking healthy tissues, or releasing dangerous chemicals into the bloodstream. And the research has yet to yield a commercially available treatment.

But none of that has stopped the market going nuts on small bits of news about the therapy. In January, Intrexon, Ziopharm and MD Andersen Cancer Center announced a licensing agreement for this kind of technology at J.P. Morgan’s biotech conference. Intrexon’s stock almost immediately jumped $10 per share, adding a billion dollars to its market capitalization, while Ziopharm’s stock price nearly doubled.

The cause: Big Pharma is suffering a science stagnation

Momentum and market optimism have a lot to do with these surging biotech valuations. But a more basic reason is that major pharmaceutical companies, the ones worth hundreds of billions of dollars, badly need new drugs.

A wave of patents on blockbuster drugs have expired in the past few years, hitting the industry’s profits—the phenomenon known as the “patent cliff.” But bringing new drugs to market has gotten more expensive. According to a 2012 study, pharmaceutical firms spend an average of $4 billion in R&D for each drug that gets approval. For some companies it’s as much as $12 billion. (Research sponsored by the industry puts the figure at $2.6 billion per drug, but such estimates, according to the 2012 study, don’t sufficiently account for high failure rates.)

A key reason is that it’s become harder to find promising substances. Pharma’s traditional expertise, known as small molecule discovery (paywall)—screening large numbers of relatively simple chemicals to find effective ones—is seeing rapidly diminishing returns. Years of investment in attempting to streamline, speed up, and automate discovery haven’t panned out (pdf). A newer class of medicines called biologics (paywall)—made up of giant molecules that adapt or exploit processes that already occur in the body—are more promising, but need a lot more investment.

Moreover, if companies try to research a broad portfolio of potential drugs—which might seem like a prudent way to ensure a few successes—they risk ending up with spiraling costs and low returns, according to a recent report from Deloitte (pdf, p.4). The internal rate of return on research and development (R&D) has fallen over the past few years, according to Deloitte’s analysis, which covers the 12 biggest R&D spenders (see chart below). On some other measures, R&D productivity has been declining for more than a decade.

As a result, Big Pharma has become reliant on drugs invented elsewhere. Nearly 60% of projected pipeline revenue—an estimate of how much income companies will get from drugs in development—comes from externally sourced products, according to the Deloitte survey. Last year’s study was the fifth in a row by the consultancy that found external candidates were more valuable than internal ones.

It’s the creators of these potential drugs that investors are excited about. But they’re risky prospects. “Most of these companies out there, most of these academic groups, they all work on the same few ideas,” says Dr. Chas Bountra, the head of Oxford’s Structural Genomics Consortium and a former GlaxoSmithKline executive. “They work in parallel and in secret and they spend maybe five six or seven years, coming up with a proprietary molecule. The first time they test it in patients, in phase 2A, the failure rate is over 90%. I can’t imagine another industry where you invest resources like that over seven years only to find out nine out of ten times you’ve failed.”

The drug companies have a pricing problem

Biotechnology companies often focus on so-called specialty drugs, which are hard to make or administer, and ”orphan drugs,” for treating rare diseases. Both are expensive to sell and lucrative to make. Orphan drugs in particular are quicker to develop because rare diseases have a small and often genetically homogeneous patient population. Clinical trials are simpler, the FDA is a bit more lenient in approvals, the US’s Orphan Drug Act of 1983 gives developers of such drugs longer exclusivity and price protection, and there’s little or no competition, all of which gives the drug makers huge pricing power. The number of approvals for orphan drugs has shot up in recent years:

Specialty drugs often have similar pricing power. Many work only in small populations. A lot of them are biologics, which are harder for generic manufacturers to reproduce after patents expire. Pharmaceutical companies are both buying up companies that produce these drugs, and devoting more of their own development dollars to them. From 2005 to 2013, the price of the average cancer drug in the US jumped by 10%, or about $8,500, every single year.

If prices were to drop suddenly, that could undermine the expensive economics of biotech research. The groups that pay for drugs in the US, a patchwork of private insurers and government plans, have long been thought of as far too fragmented to drive drug prices down. But just such a price drop is currently playing out in miniature, in the market for hepatitis C drugs.

Gilead’s Sovaldi and Harvoni were breakthrough treatments for the disease, but they were also the poster children of overpriced drugs. At list prices, a regimen of Sovaldi costs $84,000 for a one time course, and unlike with most specialty drugs, the potential patient population was huge—100 million or more worldwide. Sovaldi and Harvoni together accounted for $12.4 billion in sales last year, and are expected to exceed that total this year.

After a rival firm, AbbVie, had a cheaper, competing drug approved late last year, Express Scripts, the US’s largest pharmacy benefit manager—a company that handles prescription drug claims—said it would stop covering Harvoni and, in most cases, Sovaldi. Such “formulary exclusion” (offering one company’s drugs to patients and excluding others, often in return for a discount) is becoming more common. US pharmacy chain CVS has been a pioneer: In 2013, it excluded six drugs (pdf), last year, there were 31, and the company expects the number to rise further.

Gilead’s reaction was to double the discounts on its hepatitis C drugs to large buyers (like government health plans and certain insurers). The company kept its upper hand in market share, but at great cost. The announcement sent share prices down for the entire sector.

Where it could all unravel

In some ways, the hepatitis C situation is unique. Most specialty drugs don’t have this level of competition. And even if Gilead has to cut prices, it might make up for that with higher volumes: Payers (insurers et al.) that had restricted the treatment to the most severely ill patients because of the cost may now agree to cover more people.

But it’s a concrete and highly visible example of the sort of pricing pressure investors fear. The potential savings are so big that the experience with Gilead might prompt payers to get more aggressive, and move towards all-payer rate setting, where they negotiate together to wring a uniform low price from the drug firms.

If that were combined with more assertive efforts from the government, it could bring prices down for drugs more broadly. President Barack Obama’s latest budget proposes allowing Medicare, the government’s health-care program for seniors, to negotiate prices for the most expensive drugs—something that’s normal in other countries, where most prescription drugs are a fraction of their cost in the US. The Republican-controlled Congress is opposed, but pressure from payers and the public may force its hand.

But biotechnology companies, and their current valuations, are heavily reliant on prices staying high. If more sensible pricing takes effect, it could burst the bubble and bring those investments crashing down.