Can also be used to mean the existence of some possible means of escape from one's present predicament.
For example, when thinking about bankruptcy, people are often advised to consider whether there is a light at the end of the tunnel, that is to say some other possible way to repay their debts without taking such a desperate measure.

On the other hand, people who commit suicide often do precisely due to the percieved lack of a light at the end of the tunnel. They think that it is their only means of escape, and few things are sadder.