X-rays revolutionized medical diagnostics by allowing physicians to view the inside of the body without surgery. In the context of cancer, X-rays are crucial for the detection and diagnosis of various types of cancer, such as lung cancer and breast cancer. They help in identifying tumors, determining their size and location, and assessing whether cancer has spread to other parts of the body.