Christians were among a record number of Americans flooding theaters this weekend to see a Bible-quoting movie where good versus evil climaxes in an ancient church building. Yet, Joss Whedon, writer/director of “Avengers: Age of Ultron,” is an avowed atheist.

Pulling in the second largest opening weekend ever, behind only previous “Avengers” film, the latest Marvel movie made $191.3 million. Whedon’s latest superhero adventure resonates with Christians because, in addition to the religious symbolism throughout, quiet hope and joy serve as the foundation for the loud explosions and frenetic action.

It could seem odd for Whedon to deal in hope when he told Entertainment Weekly he has no hope for himself or this world. And one could hardly blame him. He has his own tragic hero backstory without the gifting of supernatural powers.

When he was walking to buy comic books as a 13-year-old boy in New York City, a group of guys threw him to the ground and begin to repeatedly kick him. The people filling the sidewalk during rush hour merely stepped around the beating. No one stopped. No one helped. It was the Parable of the Good Samaritan without the Good Samaritan. Whedon says he has never forgotten the moment.

But the hopelessness the teenage Whedon felt and the adult Whedon confesses does not stretch into the fictional worlds he creates. The man behind “Buffy the Vampire Slayer,” “Firefly” and both “Avengers” films recognizes the narrative necessity of the proverbial light at the end of the tunnel. “My stories do have hope because that is one of the things that is part of the solution,” he says.

Ultron returns to cause even more trouble for the heroes in another trailer for Marvel's "Avengers: Age of Ultron." (Walt Disney Pictures)

In the midst of unrest in Baltimore, destruction in Nepal, and the horrors committed by Boko Haram, people need images of hope, even if it’s fictional on film. And Christians still want affirmation for the hope they claim. “Avengers: Age of Ultron” delivers. As Jessica Gibson wrote for Christianity Today, “It affirms that the evil in the world exists and can be beaten ([G.K.] Chesterton would be proud). It’s a powerful defense of virtue and hope and faith, wrapped up appropriately in a superhero cape.”

Whedon not only offers hope the good guys will win, he says the heroes can face the insurmountable odds with a joyful determination. For Christians, this should bring to mind Paul’s admonition, “we also rejoice in our afflictions,” and his personal confession, “So I take pleasure in weaknesses, insults, catastrophes, persecutions and in pressures, because of Christ.”

Whedon’s films simultaneously exude gravitas and frivolity. His work captures what C.S. Lewis writes in “Letters to Malcolm: Chiefly on Prayer.” “Joy is the serious business of heaven,” wrote the atheist-turned-Christian apologist. Christians can sense the echoes of eternity sounding through Whedon’s work.

Whedon captures J.R.R. Tolkien’s “eucatastrophe,” which the Catholic writer describes in a letter as “the sudden happy turn in a story which pierces you with a joy that brings tears.” Light comes into darkness at a moment when all hope is gone.

The sudden turn in “Avengers: Age of Ultron,” happens when Ultron explains he was created to give humans hope, but now the menacing robot will destroy all hope. And despite failure being all but assured, the Avengers resolve to fight. The team of heroes continues so they can offer hope to the everyday citizens in danger.

The heroes’ efforts echo a telling line buried deep in an appendix of “The Lord of the Rings.” The mother of Aragorn, the king whose coronation marks the triumph over evil in Tolkien’s trilogy, says about her son: “I give hope to men; I keep none for myself.” It seems Whedon has made hope his artistic mission.

This type of hope is built into Tolkien’s understanding of eucatastrophe. In his essay “On Fairy-Stories,” Tolkien explains the eucatastrophe “does not deny the existence of dyscatastrophe, of sorrow and failure: the possibility of these is necessary to the joy of deliverance; it denies (in the face of much evidence, if you will) universal final defeat … giving a fleeting glimpse of Joy, Joy beyond the walls of the world, poignant as grief.”

The poignant joy and hope reveals itself in one of the most emotional moments of the film. Just as the Avengers believe they have removed everyone from harm’s way, a crying mother realizes her son is missing. One of the team members risks his own life to go back. It is hard not to see that scene as correcting the wrong done to Whedon himself as a 13-year-old. Hope and joy was restored even to his own personal pain.

Christians are drawn to Whedon’s work because he seemingly understands, even if he doesn’t believe, a grand narrative of Scripture. A good world has gone bad and a self-sacrificing hero has come down to set things right. There is a dark night full of global tragedies and injustices, as well as personal losses, like a boy being mugged. But the film also offers glimmers of an unstoppable dawn, of someone coming back to rescue us. Christians rarely resist a joyful story of hope, and atheist Whedon tells it better than most.

Aaron Earls is a writer living outside Nashville with his wife and kids. He writes about Christianity, culture, comics and C.S. Lewis at his blog The Wardrobe Door.

Want more religion coverage? Follow Acts of Faith on Twitter or sign up for our newsletter.