Contrast agents are substances used in medical imaging to enhance the visibility of internal body structures. They work by altering the contrast of images produced by modalities such as MRI, CT scans, and ultrasounds, making it easier to detect abnormalities and diagnose conditions like cancer.