The x-rays are absorbed to various degrees by tissues of differing densities so harder tissues such as bone don’t allow many to pass through, and soft tissues such as in the chest such as the lungs and the heart allow more to pass through and hit a plate underneath the patient. This is very much like taking a photo with the amount of light hitting the film, or these days, the sensor in a digital camera, generating an image.
Until recently, we used film like that found in older cameras, whilst now, we have plates that pass into a computer and give us a picture without need for chemical processing. This is much faster, and much safer.
X-rays can tell us a lot about the heart, lungs and the abdomen and obviously we use them to look at broken bones and damaged joints. Special techniques also allow us to look the drainage and direction of blood or of urine. If we use materials that show up on x-rays and we then take pictures to follow it so these pictures show contrast filling the bladder to show us its outline, and another shows contrast filling the shoulder joint.