PET works by injecting a small amount of radioactive substance, usually a form of glucose called fluorodeoxyglucose (FDG), into the bloodstream. Cancer cells, which have a higher metabolic rate than normal cells, absorb more of this substance. The PET scanner detects the radiation emitted by the FDG and creates detailed images of the areas where it accumulates, indicating potential malignancies.