system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do we still use X-Rays when ultrasound machines exist?

My wife is pregnant, so I've been seeing a lot of ultrasounds lately. These things are amazing; I know what my daughter looks like before she's born. I also know what her kidneys look like, which is weird.

X-rays are relatively safe in small doses, but why bother with even a small risk if we can use an ultrasound machine, which is safe enough for a baby in the womb? I'm sure an ultrasound machine is expensive, but X-ray machines probably are, too. And you don't have to line the walls of your office with lead.

Is there something X-rays can do that ultrasounds can't?
gpt
Yes.  X-rays provide higher resolution than ultrasound can.  And X-rays are better at imaging things like bones, which ultrasound has trouble penetrating.  
   
Both types of imaging are valuable.  There are other imaging tools (MRI etc.) that can do other things that X-ray and ultrasound can't.  Doctors try to use the best tool for the job, minimizing risk to the patient while maximizing their ability to see what they need.