Sylvia Rosas decided to go to the emergency room after getting stung by a bee in her yard in Valrico, Florida. She had experienced allergic reactions in the past, but didn't have an EpiPen on hand.

However, what really hurt was the $12,000 bill she received for the visit to the ER.

The 53-year-old said she was seen by several doctors, who ordered thousands of dollars in blood tests and an EKG during the 2015 visit that lasted less than two hours. Since the hospital was out of network, her insurer wouldn't cover the visit, and she ended up having to pay the entire bill.

"Never did I think I'd have this type of a bill," said Rosas, a mortgage loan officer who says she's now hesitant to go to the doctor. "I was there for such a short time."

Rosas isn't the only one getting hit with big bills after a trip to the ER.

Spending on an emergency room visit rose to $1,917, on average, in 2016, up more than 31% from four years earlier, according to the Health Care Cost Institute, which analyzes spending and usage of nearly 40 million Americans with employer-sponsored coverage.

The spike in spending was driven almost entirely by an increase in the prices charged by hospitals, even as ER usage remained relatively flat. The spending covers the hospitals' charges for stepping foot in the ER, known as a facility fee, as well as some tests and services. It doesn't include ER evaluations by doctors, who usually send patients a separate bill.

Overall, the soaring price of ER visits, along with steep hikes in prescription drugs and outpatient surgery costs, have helped fuel a 15% increase in overall health care spending, the institute found.

There may be several reasons why it's getting costlier to go to the emergency room, experts said.

The price hikes stem in part from the fact that ERs are seeing a greater number of patients with more severe medical problems, said Niall Brennan, the institute's CEO.

Hospitals base their ER facility fee charge on the severity of the condition they are treating. Folks with simpler issues, such as cuts or fevers, are more often turning to urgent care centers or pharmacy clinics. So emergency rooms are more likely to receive patients with serious problems, such as chest pain or asthma attacks, which are more expensive to treat.

Related: Americans spend more on health care, but have shorter life spans

Also, more emergency rooms now have access to advanced -- and pricey -- technology, such as CT scans and MRIs, said Renee Hsia, professor of emergency medicine and health policy at the University of California, San Francisco. And patients expect to have more testing done in the ER rather than waiting to go to a lab or doctor's office after they are discharged.

The American Hospital Association challenged the institute's study, saying that annual hospital price growth rates are at near record lows. But the industry group did agree that emergency rooms are treating more complex conditions, citing its report from 2013 that showed Medicare patients treated in the ER had more severe illnesses and visited more frequently.

Still, many ER patients are stunned by the bills they receive.

Rick Brown tried to avoid going to the emergency room after he fell into a small hole by his pool in November and hurt his ankle. He tried icing and elevating it, but after a few days the pain was excruciating.

He finally went to the ER near his home in Brick, New Jersey, where he had an X-ray and was seen by a physician assistant. Brown, who arrived at the hospital on his own crutches, learned he had fractured his ankle. The 58-year-old was given a splint, a prescription for painkillers and a recommendation that he follow up with a specialist.

A few weeks later, the bills started coming in -- including a $2,600 for the ER and $5,700 from a physicians' office. His insurance paid half the ER fee, but wouldn't cover the doctor charges because the provider was out-of-network.

Brown, a bartender, was furious, noting that he was twice asked for his insurance card in the ER. Had he known he'd be on the hook for thousands of dollars, he said he would have hobbled out or waited to go to the doctor's appointment he had made for later in the week.

"To have insurance and to be facing these astronomical bills, I get incensed," said Brown. "You're in a lot of pain and you have insurance. You are expecting it to be covered."

Brown plans to talk to the hospital and the physicians' office to try to reduce the charges.

Related: 4 reasons why US health care is so expensive

That's a good move, said Martin Makary, professor of surgery and health policy at Johns Hopkins University. When patients come to the ER, they don't need to sign any paperwork promising to pay in full, Makary said. Federal law requires emergency rooms to screen and stabilize anyone who comes through the doors.

Makary published a study last year that found that hospitals mark up emergency services -- such as suturing a wound or interpreting a CT scan -- by an average of 340% more than what Medicare allows. (The Medicare allowable amount includes what Medicare reimburses, as well as any deductibles or co-pays the patients pay.) So consumers should try to bargain providers down if they get a big bill.

"Prices are highly fluctuant and often negotiable," he said. "As with new cars, people are not expected to pay the sticker price."