Sources here said that for the Bachchans it was a spiritual trek the family usually undertakes in times of crisis.
Just after midnight, Bachchan and his actor-son Abhishek walked with folded hands from their home in northern suburban Juhu to the Siddhivinayak temple, which is dedicated to the elephant-headed Hindu god Ganesha, in Prabhudeva in central Mumbai, a local TV channel quoting witnesses said.
Sources said the Bollywood star's octogenarian mother is ill and the family earlier had visited several major temples, apparently also to pray for Abhishek and his actress friend Aishwarya Rai, who are reportedly set to marry but whose stars are not in harmony.
Last year, after Bachchan recovered from a life-threatening surgery, the family made a similar barefoot walk to the temple to thank Ganesha.
Every Tuesday, hundreds of thousands of devotees from across Mumbai and Maharashtra visit the Siddhivinayak temple, seeking Ganesha's blessings. It is quite common to see thousands of devotees walking barefoot to the temple through the night.
On Tuesday, the Bachchans had no footwear on and were walking barefoot, like most devotees.
The father-son star duo, walked side-by-side, ringed in by a posse of security men, and despite the hour, scores of fans trailed the stars throughout the four-and-a-half hour walk to the temple.
The 64-year-old star and his family after reaching the temple offered prayers, flowers and lit incense sticks amid the chanting of hymns by priests.
"They offered special prayers to Lord Siddhivinayak in whom the family has immense faith," a priest at the temple told the television channel. The Bachchans, however, did not speak to the media.