During a CT scan, the patient lies on a table that slides into a cylindrical machine. X-ray beams rotate around the body, and detectors measure the amount of X-rays absorbed by different tissues. A computer then processes this data to generate detailed images. For more accurate results, a contrast agent is sometimes injected to highlight specific areas.