Ms. McCain’s father, the Republican Senator John McCain of Arizona, has glioblastoma, which Beau died of in 2015.

“I think about Beau almost every day, and I was told,” she said and paused, choking up, “that it doesn’t get easier but that you cultivate the tools to work with this and live with this. I know you and your family have been through tragedy that I couldn’t conceive of. What would you tell people — —”

Mr. Biden, 75, stopped her, took a seat next to her, grasped her hand and said to her directly: “One of the things that gave Beau courage, my word, was John.”

“You may remember when you were a little kid, your dad took care of my Beau,” he said to her, while Ms. McCain, 33, wiped away tears. “And Beau talked about your dad’s courage — not about illness, but about his courage.” Mr. McCain was the Republican presidential nominee in 2008, the year Barack Obama was elected president and Mr. Biden vice president.

While the brief conversation won’t alter the big policy debates of the day — Mr. Biden and Mr. McCain have taken different, and often opposite, stances on major points of contention — it momentarily bridged the aisle, prompting people on social media to share how deeply they were moved.