The trope of Light Equals Hope is a visual one, used by cinematographers and other film professionals who really like their Symbolism.
Essentially there's a light somewhere in the scene. It is the literal light of Hope. Because there's a chance evil could win — there is an encroaching darkness. The suspense builds as the scene flickers between light and dark.
If in the end the light is not snuffed out by the darkness, there is hope of things going well for the characters. If the darkness wins and the scene is plunged into shadows, then evil (or another dark trait) is getting its turn at bat whether we like it or not.
This is just visual media playing on the old concepts of bright light, especially sunlight, being good and purifying; nothing evil can survive when someone has shed some light on the subject. Rationally we know this to be untrue but the symbolism is solidly rooted in visual storytelling.
Commonplace in media where creatures literally cannot deal with sunlight, such as vampire fare.
Naturally, the inverse works as well. All seems lost for the protagonist(s), but a literal ray of hope breaks through the gloom and things begin to change in the hero(es)' favor.
There is also a variation that is not good/evil related but still uses the light as hope symbolism. A light bulb swinging or flickering while a life hangs in the balance. If the flickering stops and the light continues to shine, the endangered life will pull through, even if some downtime is required. If it goes out, the character has died. This is also true if the bulb's effectiveness is diminished because something has splashed onto it like blood or ichor.
Subtrope to Light Is Good. Any usage of this will inevitably have some form of Light/Darkness Juxtaposition. See also Cue the Sun. Can cross over with Empathic Environment. Compare Lights Off, Somebody Dies wherein the lights going out allows evil a brief moment to do its dirty work.
This trope is often used in a significant turning point in a plot, so beware UNMARKED SPOILERS.
- Fatal Attraction: Alex, after she's been rejected, is sitting on the floor of her apartment with a broken lamp. She has the switch in her hand and is clicking it back and forth. Click: lights on. Click: lights off. It's an indication she's (consciously or unconsciously) weighing her choices. Lights: leave him alone and move on with her life. Dark: Go all vengeful stalker and ruin his life. At the end of the scene she clicks the switch one last time to leave her sitting in darkness. Her behavior becomes increasingly unhinged from that point forward.
- The Force Awakens: Rey, Finn, Chewie and Han are racing to stop the First Order's current sun-eating Death Star like superweapon. When the sun goes out, it's all powered up to blast a planet into space dust. On the way, Han Solo meets with Kylo Ren. As Han reaches toward Kylo, we see the sun outside, its light weak and small but still there. Kylo says that he's facing a struggle he's not strong enough to handle on his own, and asks for Han's help. Han reaches forward as Kylo holds out his lightsaber. The sun is extinguished and Kylo guts Han, thanking him for helping.
- Fright Night (1985) has Charlie with his back against the wall as the vampire closes in. But daylight happens, and he throws open the curtains to let the sun shine in, reversing the tide of battle in an instant.
- Pacific Rim shares this with Empathic Environment. The entire film from our first look at the Shatterdome takes place, day or night, in torrential rain. No matter how many fights there are, the humans win them at a dear price: lost Jaegers and lost lives. Only after Mako and Raleigh have scored a decisive victory do we finally get to see the sun come out.
- In The Professional, Mathilda's terror after her parents and brother are brutally murdered is contrasted with her relieved expression as Leon opens his door to help her, and light floods across her face.
- In The Lord of the Rings: The Two Towers, The Battle of Helm's Deep takes place during night, in a heavy rainstorm. Saruman's army massively outnumbers the Rohirrim, who are certain they have no chance to win. However, when dawn breaks and light appears on the horizon, The Cavalry led by Gandalf the White and Eomer arrive and turn the tides of the battle.
- Used in Children of Men when from the first frame we see Jasper (Michael Caine), he's covered in sunlight. Theo (Clive Owen) comes out from the darkness from the train station into the light to hug Jasper, symbolising Theo's only redemption from his bleak life.
- Great Expectations: Pip goes inside dark, shut-up Satis House, and meets Estella, recently dumped by Drummle. She's sitting in the dark living room in Miss Havisham's old chair, deep in depression, seemingly resigned to growing old alone. Pip refuses to accept this, tearing down all the curtains and the boards over the windows, letting light into the house for the first time in decades. Pip and Estella go running off together arm in arm.
- Stairway to Light: The mental patients of an 18th-century Bedlam House are kept locked in chains in a dark basement prison. The light at the top of the stairs to the outside symbolizes mental patients being liberated from chains and, hopefully, cured.
- The Villain of Don Bluth's feature Rock-A-Doodle keeps the entire county under the gloom of rainclouds, flooding the valley and making the smaller Funny Animals easy pickings for himself and his lackeys. Some of the victims keep their tormentors at bay with a flashlight, but as The Villain points out smarmily, "When the batteries expire, so do your friends." Up until the climax, The Dragon has been able to keep The Hero sidelined, but once Chanticleer gets his Heroic Second Wind, his crowing raises the sun, which dissipates the clouds and negates The Villain's Black Magic. It's amazing what sunbeams can do.
- The Princess and the Frog: Ray is a firefly who was a literal ray of hope for Tiana and Naveen, using his amazingly bright tail light to banish and even destroy the shadow creatures sent after them. When Dr. Facilier steps on him, he only lives long enough to see Naveen and Tiana declare their love. His light goes out. Shortly thereafter, though, they give him a proper New Orleans funeral and once his body is sent off, Tiana, Naveen and Ray's family are bathed in light as he is rewarded for his service by becoming a literal star in the sky. Everyone's grief is wiped away by hope and joy.
- The First Flame from the Dark Souls series was the first fire to ever exist, signifying the Age of Fire and the rule of the various Gods that reign over the world. Should the flame ever go out, the Age of Dark will occur. The fire fading is implied to be the cause of the curse of the undead plaguing mankind. To prevent the Age of Dark from ever happening, linking the fire and perpetuating this is the big goal of each game. Subverted, as it is implied that linking the flame and keeping the Age of Fire going is an affront to the natural order of the cycles the world is going through, Gwyn linking the flame for the first time being referred to as "the first sin".
- In The Elder Scrolls IV: Oblivion, the Oblivion Crisis begins when the Dragonfires, a symbol of the imperial family and a Cosmic Keystone that maintains the barrier between the physical world and the Realms of Oblivion, are extinguished. One major city is promptly wiped off the map, and the main plot revolves around finding the last person with Royal Blood to rekindle the Dragonfires before the Thinning Dimensional Barrier collapses entirely.
- In Daughter of the Lilies, Light Is Good, while the demonic Drath spirits manifest as clinging shadows that infect or outright overwhelm their mortal targets through despair. On two occasions, mages who rescue Drath victims get a sudden heavenly backlight.
- Balto is a fictionalized account of the desperate sled dog relay of diphtheria antitoxin from Nenana to stricken Nome in 1925. The telegraph station at the edge of town has a red lantern lit outside its door that acts as a guide light for the final dog team, and to signal the townsfolk that the team has attained its checkpoints en route. After many hours without a message from the nearest checkpoint, nor any sight or sound of the finishing team, the telegrapher sadly extinguishes the lantern, believing the antitoxin relay has failed.
- Cordell Barker's cartoon The Cat Came Back has Old Mister Johnson take a railway handcar into the Canadian mountains in an effort to abandon a troublesome cat. He derails at one point, and tumbles down a mine's air shaft into utter darkness. Played for Laughs as he lights a match to assess his situation, and sees hundreds of rats staring back at him. One rat blows out the match, just before a Gory Discretion Shot. The man survives, though thoroughly nibbled.
- Gravity Falls season 1 episode "Summerween" has Dipper, Mabel, Candy and Grenda racing against time to gather enough candy to satisfy the Summerween Spook. His deadline is when the last Jack-O-Melon is blown out. The kids make haste and manage to get enough candy with time to spare, but because Dipper was embarrassed by his kiddie costume and more interested in looking cool for Wendy, he shoves the candy out of view. Unfortunately he shoved it right into a creek where it all floated away. The other kids are upset but determined to start again. But it's gotten late enough that the townsfolk are blowing out their Jack-O-Melons, casting the main street a little deeper into darkness with each one. Grenda thinks quickly and grabs the last one from Old Man McGuckett before it can be blown out. Unfortunately her gusty sigh of relief is enough to snuff the flame. The Spook looms out of the darkness ready to take them.