Several studies have shown that behavioral therapy for chronic pain can be beneficial for chronic pain and that behavioral therapy for insomnia can be beneficial for insomnia. However, seldom do chronic pain patients with insomnia receive a behavioral treatment for insomnia. The purpose of this study is to evaluate whether treatment for insomnia is helpful for pain and whether treatment for pain is helpful for insomnia. It will also assess whether a combined treatment is any more or less effective for pain or for sleep. Finally, the study will assess whether any of these treatments leads to improvements in immune function.