I don't understand how this answers the question about X-ray cost.
2. Dental x-rays are more often than not elective procedures. It's much easier to comparison shop elective procedures than emergency procedures. Therefore market forces frequently compel the dentist to come up with an up front cost for an x-ray.
The same market forces don't apply to hospitals because you can't wait a week or more while you shop around for treatment for a shattered hip.