Both. Yoga done properly and with good alignment can both treat lower back and neck pain as well as help people keep a good strong core to protect their back. I recommend it to my patients all the time and practice yoga myself.
Both. Yoga is excellent for building core muscles to support your back, and can prevent injuries. It also excellent for stretching and strengthening after an injury.
Good for both. It can help in both ways.