NEW YORK (CNNMoney) -- Get a hip replaced at Olympia Medical Center in Los Angeles, and Medicare will pay the small, doctor-owned hospital $15,585, or about 13% of what Olympia charged in the bills it submitted.
But go less than six miles away to Ronald Reagan UCLA Medical Center for the exact same procedure, and Medicare will reimburse the facility nearly $26,000, or almost 30% of what it billed.
The wide variance between hospital charges and Medicare payments came into the spotlight after the Centers for Medicare & Medicaid Services released detailed data on hospital billing earlier this month. CNNMoney analyzed the data and found that payments for joint replacements vary from as low as $9,100 to more than $38,600.
The disparity has to do with the location, mission and clientele at each medical center.
Medicare pays a rate that's set by law for various procedures. What the hospital actually charges -- $117,449 in the case of Olympia, and $87,418 for UCLA -- doesn't matter. And hospitals that agree to accept Medicare, which nearly all do, cannot bill patients for any unreimbursed costs.
But Medicare also pays a little extra to certain hospitals, like those that are in an expensive area, treat a lot of uninsured or sicker patients, or serve as a teaching hospital for recent medical school graduates.
"The disparities in Medicare payments are linked to different circumstances," said Brian Cook, spokesman for the Medicare agency. "We think that's a fair price."
These adjustments can add up to a much heftier check. For instance, Medicare pays an average of $54,682 for a major heart procedure at the University of Maryland Medical Center in Baltimore, compared to $14,550 to Springhill Medical Center in Mobile, Ala.
In the Los Angeles case, Medicare pays UCLA more because it serves as both a teaching hospital and a transplant center, and has higher uncompensated costs for care. UCLA also treats a higher percentage of sicker patients than its smaller rival.
But hospitals say they are losing money on Medicare patients, to the tune of nearly $24 billion a year, according to Caroline Steinberg, vice president of the American Hospitals Association, an industry trade group. Hospitals say that forces them to bill patients with private coverage more.
For every $1 a hospital actually spends on care, Medicare generally reimburses 90 to 95 cents, according to the trade group. Private insurers usually pay $1.34 per dollar of expenses.
While the federal government released the data in hopes of helping consumers better understand the cost of health care, the information shows how hard it is to untangle what procedures cost and what the payment should be, said Stuart Guterman, vice president at The Commonwealth Fund, which advocates for a better health care system.
He was surprised to see the wide variation in Medicaid payments, and would like more detailed data on what specific procedures cost and what gets reimbursed.
"How do we figure out what the right amount is to pay for good health care?" he said.
The Medicare data can at least give patients a starting point for negotiating their charges. That's particularly true for the uninsured or those with high-deductible plans, said Dan Mendelson, chief executive of Avalere Health, an advisory company for insurers.
"It's important for consumers to be aware of the disparity between hospital charges and Medicare payments," he said.