Use the term silver lining when you want to emphasize the hopeful side of a situation that might seem gloomy on the surface.
The common expression "every cloud has a silver lining" means that even the worst events or situations have some positive aspect. You are most likely to remind a sad or discouraged friend that there is a silver lining as a way of cheering him up. The origin of the phrase seems to be John Milton's 1634 poem "Comus," which includes the line, "Was I deceived? or did a sable cloud/Turn forth her silver lining on the night?"