Purpose: This pilot randomized clinical trial studies the effects, good and/or bad, of taking doxepin hydrochloride compared to placebo (inactive drug) in treating esophageal pain in patients with thoracic cancer receiving radiation therapy to the thorax with or without chemotherapy. Doxepin hydrochloride is a tricyclic antidepressant drug which was recently shown to be helpful for mouth pain in patients receiving radiation therapy. Part of doxepin hydrochloride’s drug action takes place at the surface of the esophagus, which may be helpful in reducing the pain caused by radiation therapy.