In a medical emergency, you may have a surprisingly difficult time finding a bed in a hospital. This is because elective admissions — that is, patients whose hospital stays have been scheduled in advance — take priority over emergencies.

Such a preference for elective admissions might be unexpected, as emergency patients are, by definition, emergencies. But elective patients have attributes that make them financially attractive. They arrive promptly in the morning; they are well-insured; and they undergo invasive procedures that represent a significant revenue stream for hospitals.

An analysis of more than 1 million Medicare cases indicates that hospitals earn about $700 more on each elective admission than on each patient admitted through the emergency department (ED).

Predictability is often touted as a reason for prioritizing elective admissions. But while predictability is thought to be in short supply in the ED, the data — and our experience as ED doctors — argue otherwise. The number of patients admitted through the ED are about the same every day of the week, whereas elective admissions peak Mondays through Thursdays and tail off toward the weekend. This is designed to minimize the need for weekend work by the doctors who perform procedures.

The weekday peak in elective admissions creates a bottleneck that results in admitted patients “boarding” in the ED. Boarded patients have nominally been admitted to the hospital, yet they physically remain in the ED until vacancies in the hospital arise. But vacancies may not arise for hours or, in extreme cases, days.

Boarding increases the risk for patients whose condition might become unstable: patients with new-onset diabetes who require intensive monitoring; patients with metastatic cancer, who require high doses of pain medication; and critically ill patients, who require advanced life support.

A 2007 publication by the national Institute of Medicine found that “ED overcrowding is a nationwide phenomenon, affecting urban and rural areas alike” and noted that “on a typical Monday evening, 73 percent of hospitals reporting boarding two or more admitted patients.”

Boarding is not merely inconvenient. It is also unsafe. As the Institute of Medicine report put it: “The potential for errors, life-threatening delays in treatment, and diminished overall quality of care is enormous in these situations.” In a 2011 study of more than 40,000 ED admissions, the risk of in-hospital death nearly doubled, from 2.5 percent to 4.5 percent, in patients who boarded for more than 12 hours compared with those who boarded for less than two hours.

Boarding also tends to exert a disproportionate effect on vulnerable populations. The length of ED stay has been found to be longer for African American and Hispanic patients. The elderly and patients with mental-health issues are more likely to receive their initial inpatient care on gurneys in the ED.

The problem of boarding can be solved by increasing inpatient hospital bed capacity, but the cost of increasing capacity can be daunting to many medical institutions that are already struggling to maintain profitability.

An alternative is to increase efficiency by a process known as “smoothing.” Smoothing reorients schedules to distribute surgical cases uniformly across the workweek, mitigating the bottleneck to emergency admissions. At the Mayo Clinic, smoothing resulted in “improvement in operating room operational and financial performance.” At Massachusetts General Hospital, which performs more than 36,000 operations a year, smoothing decreased congestion and improved effective operating room capacity.

But smoothing can be disruptive to the doctors who perform the surgeries and procedures that drive hospital revenues.

It can require them to work less desirable hours and alter long-standing practices, such as having a dedicated day of the week in the operating room. As a result, adoption has been slow, according to research published in 2012 in Health Affairs. Only 6 percent of hospitals with the busiest EDs were found using smoothing for surgical scheduling in a 2015 study.

At the institutions where we work, the University of Colorado improved efficiency by decreasing unnecessary admissions by 20 percent, despite a 53 percent increase in ED volume. And, Boston’s Beth Israel Deaconess Medical Center implemented a number of techniques to speed patient flow through the system: bedside registration, electronic dashboard that displays bed status throughout the hospital, physical expansion of the ED, and a paging protocol to notify senior leadership of impending capacity issues. When hospital capacity is strained, BIDMC administrators work with doctors in the community to direct emergency admissions to other hospitals that have capacity.

Achieving these gains on a national level will require Medicare and private insurers to up their reimbursement rates to hospitals for emergency admissions. Making that change will be costly, but it will help ensure that, in an emergency, your hospital bed is ready when you need it.

Richard Klasco is an assistant professor of emergency medicine at the University of Colorado School of Medicine. Richard Wolfe is chair of the Department of Emergency Medicine, Harvard Medical Faculty Physicians at Beth Israel Deaconess Medical Center in Boston, and is a member of the board of directors of the Society for Academic Emergency Medicine.