A chest X-ray is a painless imaging test that takes pictures of your heart, lungs, airways, bones, vessels, and other structures in your chest. X-rays use electromagnetic radiation to create an image of the inside of the body. Getting a chest X-ray is painless and simple—you’ll be positioned near the X-ray machine and asked to move into different positions to take different pictures of your chest. Your doctor can use the results from your chest X-ray to diagnose various conditions such as heart failure, fluid around the heart, pneumonia, or lung cancer.