There are high rates of depression in people with advanced (cannot-be-cured) cancer. Depression worsens a person’s quality of life (QoL), may become a burden for carers and may prolong a patient’s hospital stay. Cognitive–behavioural therapy (CBT) challenges unhelpful thinking and ways of doing things to help improve mood. CBT is effective for treating depression, but it is unclear if it works for depression in advanced cancer patients. Advanced cancer patients with depression were entered into a research trial to see if the addition of CBT to usual care was better at improving depressive symptoms than usual care alone. We also wished to evaluate whether or not CBT helped to save costs. We enrolled 230 participants from hospital clinics, general practitioner (GP) surgeries and the Marie Curie Hospice, Hampstead. A computer program randomly allocated people to one of two groups: (1) CBT plus usual care or (2) usual care alone. Everyone received usual care from their GPs and oncology teams. Patients who were offered the addition of CBT received up to 12 1-hour sessions delivered through a community service called Improving Access to Psychological Therapies. We measured depression using a questionnaire called the Beck Depression Inventory, version 2 collected at the start of, and at 6, 12, 18 and 24 weeks into, the trial. We also collected other measures, including those relating to health, QoL and resource costs at various times. Overall, there was no improvement in symptoms of low mood or cost savings with the addition of CBT to usual care compared with usual care alone. This means that CBT does not benefit people with depression and advanced cancer, and should not be routinely offered. However, those widowed, divorced or separated appeared to benefit from CBT over and above their usual care. CBT targeted to these people may be helpful and may ensure that resources are allocated in the best way.