BACKGROUND: We had previously developed an algorithm for Medicare claims data to detect bone metastases associated with breast, prostate, or lung cancer. This study was conducted to examine whether this algorithm accurately documents bone metastases on the basis of diagnosis codes in Medicare claims data. METHODS: We obtained data from Medicare claims and electronic medical records of patients 65 years or older with a breast, prostate, or lung cancer diagnosis at a teaching hospital and/or affiliated clinics during 2005 or 2006. We calculated the sensitivity and positive predictive value (PPV) of our algorithm using medical records as the "gold standard." The κ statistic was used to measure agreement between claims and medical record data. RESULTS: The agreement between claims and medical record data for bone metastases among breast, prostate, and lung cancer patients was 0.93, 0.90, and 0.69, respectively. The sensitivities of our algorithm for bone metastasis in patients with breast, prostate, and lung were 96.8% [95% confidence interval (CI)=83.8% to 99.4%], 91.7% (95% CI=78.2% to 97.1%), and 74.1% (95% CI=55.3% to 86.8%), respectively; and the PPVs were 90.9% (95% CI=76.4% to 96.9%), 91.7% (95% CI=78.2% to 97.1%), and 71.4% (95% CI=52.9% to 84.8%), respectively. CONCLUSIONS: The algorithm for detecting bone metastases in claims data had high sensitivity and PPV for breast and prostate cancer patients. Sensitivity and PPV were lower but still moderate for lung cancer patients.