What does it mean?
This means that there is always something to appreciate in life, but one needs to have hope, and try to look for it.
Does this foreshadow anything?
This is broadly applicable of course, but has particular relevance to two later moments in the series:
Most immediately, of course, the Dementors, representing depression, can literally be driven off by happiness in the form of a bright light.
Later, Ron is able to find Harry and Hermione by using the Deluminator.
As it says in Dumbledore's will (film version only):
First, to Ronald Billius Weasley, I leave my Deluminator, a device, of my own making, on hope when things seem most dark It will show you the light.
This is a callback to the line from PoA.
I get that the Dumbledore character in the movie said it. But it bothers me because when people credit it to Dumbledore, I feel like it implies that the original (real) Dumbledore of JK Rowling's creation would have said it. But he didn't, and I don't think he would have said something so simplistic and sappy. He was always more sophisticated than that, even when he was being silly. So it bothers me that people credit this to Dumbledore all the time, when the real Dumbledore never would have said it. One could argue that it doesn't really matter, since the character's name in the movies is Dumbledore, so who else are they going to credit it to? But to me the Dumbledore in the movies (like many of the characters) is just a weak, altered shadow of the book version.
Your thoughts?