A passerby spotted smoke early Tuesday morning and helped get six residents out of a house on fire in East San Jose.

San Jose Fire Capt. Peter Caponio said the good Samaritan, Jeff Ray, was driving by the area of Pala Avenue and Avenue B near North Capitol Avenue about 3 a.m. and saw smoke coming from the roof, knocked on the door and got everyone out safely - just before the roof partially collapsed, making the home uninhabitable.

Two children, their grandparents - and their dog - were among those inside, Caponio said, and everyone got out safely. "It was awesome that he took the time to do that," Caponio said.

Ray said he was just in the right place at the right time and it was a twist of fate that brought him to the neighborhood and past the house.

"Sometimes late at night is the only time I can get out and do shopping and things like that so I go to Safeway because they are open 24 hours," said Ray, who cares for his elderly parents and disabled brother.

On Tuesday, Ray missed a turn and drove a block too far. Then he smelled smoke.

"It wasn't fireplace-type smoke like firewood," he said. "It was dirty smoke, and it smelled like something that shouldn't be burning."

Ray circled the block a few times until he found the burning house. He said he could see under the eaves, and the whole attic area was glowing orange. So he started pounding on the front door.

One family member who lives at the home but wasn't there at the time of the fire said she is forever grateful. "Because of him, everyone is alive," said Isabella Diaz-Martinez.

Ray stops short of calling himself a hero.

"It's just doing what anybody would do," he said. "If you see something bad, you try to do something about it."

Family members were still a little shaken up Tuesday evening. They said the home is not a total loss, but it will be some time before they can move back in.

The Red Cross of Silicon Valley came to assist the displaced residents, one of whom is likely to have recently graduated. A "Congrats Grad" sign hangs proudly on the outside of the house.

NBC Bay Area staff contributed to this report.