Methods and devices to treat discogenic lumbar back pain are disclosed. Electrodes are implanted within the anterior epidural space of the patient. A pulse generator that is connected to the electrodes delivers electrical impulses to sympathetic nerves located within the posterior longitudinal ligament (PLL) of the lumbar spine and outer posterior annulus fibrosus of the intervertebral disc. In alternate embodiments, energy directed to nerves in the PLL may be from light or mechanical vibrations, or the nerves may be cooled. The electrodes may also be used diagnostically to correlate spontaneous nerve activity with spinal movement, fluctuations in autonomic tone and the patient's experience of pain. The electrodes may also be used to generate diagnostic evoked potentials. The diagnostic data are used to devise parameters for the therapeutic nerve stimulation. Automatic analysis of the data may be incorporated into a closed-loop system that performs the nerve stimulation automatically.