Time-related biases in cohort studies can produce illusory "beneficial" effects of medications due entirely to an artifact of the analytic design. We describe "time-window bias" in the context of a case-control study, reporting that statin use was associated with a 45% reduction in the incidence of lung cancer. This bias results from the use of time-windows of different lengths between cases and controls to define time-dependent exposures. We illustrate the bias using a population of 365,467 patients from the United Kingdom's General Practice Research Database, including 1786 incident cases of lung cancer during 1998-2004. The case-control approach used in the published study yielded a rate ratio of lung cancer incidence of 0.62 with statin use (95% confidence interval = 0.55-0.71). A case-control approach that properly accounts for time produces a rate ratio of 0.99 (0.85-1.16)-suggesting no benefit of statins on lung cancer risk. We show analytically that the magnitude of the bias is proportional to the ratio of the unequal time-window lengths.