In a round, sonorous voice as surprising as it was beautiful, the woman began to sing.

“Thank you, for your presence today,” she crooned in a gospel style, swaying to her own beat. “May I say, hallelujah to you. May I just say, God bless you for your heavenly word, for what you do.”

O’Malley’s somber face broke into a grin as he chuckled in delight. A Christmas tradition was marked by this, and other, unscripted moments.

St. Francis House, the largest day shelter in New England, provided about 900 meals throughout the day, including 500 sit-down lunches: turkey, stuffing, green beans, and apple pie, served on gold-rimmed china used only on the most special occasions.

‘These are painful and dark times, and our God comes into those times and teaches us how to love.’

Atop each table, covered in red-and-white cloth, sat a gingerbread house dotted with marshmallows and gummy bears, donated by Boston College students.

Karen LaFrazia, executive director of St. Francis House, said O’Malley’s visit is an important highlight of the year for those who depend on the shelter for daily needs. They are often people misunderstood by society, she said, and few recognize the small improvements they make each day with the help of the shelter.

“These little miracles every day, you just walk through this building and you see them,” LaFrazia said.

Still, she said, it is sometimes challenging on a holiday to set aside the larger problems facing the city’s homeless communities, and the need for widespread affordable housing, mental health services, job opportunities, and support for substance abuse issues.

“When we have those things,” LaFrazia said, “that will be the real Christmas miracle.”

O’Malley, who visited St. Francis House before a scheduled Mass at the Cathedral of the Holy Cross, told reporters before delivering his prayer that it is sometimes challenging to come up with the right words to provide comfort to those whose Christmases are spent at St. Francis House.

“We hope that through the word that we will open and touch their hearts, and the carols that we sing will help them think of other Christmases . . . when things were better in their lives,” O’Malley said before his prayer.

The recent shooting in Newtown, Conn., he said, is also cause for reflection on the holiday. The tragedy at Sandy Hook Elementary School, he said, parallels the story of Christmas and the massacre of children by a king desperate to kill the baby Jesus.

“Unfortunately, Christmas for many people has become just commercialism and fantasy and gifts and lights and food,” O’Malley said.

“But the real message of Christmas is one of sacrifice and solidarity and the Christmas story, where a tyrant in Bethlehem is killing all of those children.”

“These are painful and dark times,” O’Malley continued, “and our God comes into those times and teaches us how to love.”

During his prayer with the homeless, O’Malley recalled a pivotal moment in the midnight Mass at the Cathedral of the Holy Cross he had attended the night before.

A cast of children reenacted the Christmas story, and one boy had the role of the owner of an inn. He was tasked with saying one line, O’Malley recalled: “There’s no room in the inn.”

But after the boy delivered his line and turned Mary, Joseph, and Jesus away, he could not help himself from interjecting his own thoughts.

“Wait!” the boy called out, according to O’Malley. “You can stay at my house!”

The boy, “in his goodness, wanted to change history,” O’Malley said.

As O’Malley concluded his remarks to the room, he bid those gathered to join him in singing a few Christmas carols. Each person in the room held a sheet with lyrics to a few songs — “Hark! The Herald Angels Sing,” “O Come, All Ye Faithful,” “Joy to the World” — but O’Malley began to sing the opening strains of “Silent Night.”