the phone line runs at 45VDC or so but drops in voltage when connected to the CO. The ring comes over at something like 70VAC. You would need to build a circuit that isolates the DC voltage.
Anyway, if you use the power for something like a nightlight, you are stealing power from the phone company and opening yourself up to criminal prosecution......