X-rays (more appropriately called radiographs) are done by positioning the animal under a beam of radiation which illustrates the architecture inside of the animal (be it in their chest, abdomen, or looking for bone damage). On a radiograph, bone and other very dense structures appear white, soft tissues such as fluid and organs show up in shades of grey, and air appears black. X-rays illustrate changes in bone, abnormal shapes in the abdomen, or other dense structures (foreign bodies or stones). What radiographs do not do is allow us to determine where an abnormality is originating from, if there is blood flowing inside, or allow motion capture (taking video) i.e. Radiographs are static images
Ultrasound, on the other hand, shows images in real-time, and the video can be recorded. Also, there are modes to monitor flowing fluid (blood pulsing in vessels or through the chambers of the heart), and if masses or abnormalities are seen, they can often be traced to their origin (which organ is affected). The ultrasound beams (high frequency sound waves) pass through certain tissue and are echoed back to the instrument by denser organ tissue. Ultrasound is not good for looking at very dense objects such as bones or air-filled organs such as lungs.
The difference in the tests show why we often decide to choose one or the other if looking for bone fractures or bladder stones, radiographs are the obvious choice. To evaluate for heart anomalies or to identify abdominal masses, ultrasound has an advantage. Some conditions, however, may require both tests. Both tests offer very valuable information and can allow for better diagnosis of problems, but are very different in the ways which they do it Your veterinarian will be able to guide you in the process of deciding how to proceed.