If the purpose of life is just to live this life and then die, it's hard to answer the purpose of pain question; but if we can help people see from an eternal perspective - that all of this is working together to prepare us for something higher than we've ever imagined, more noble than we've ever dreamed - then we discover some hope that we can hold on to.
