Dr. Kim Bullock, a neuropsychiatrist at Stanford University, says she made the remarkable discovery by accident. While studying virtual reality for conditions like severe anxiety, a welcome side benefit of that treatment: patients’ chronic pain disappeared.