Henrik Tallinder, Cody McCormick, Drew Stafford and Tyler Ennis also scored for the Sabres, who have beaten the Sharks five straight times.
Tyler Kennedy and Tomas Hertl scored 70 seconds apart early in the third to erase a two-goal deficit for the Sharks. Tommy Wingels got another equalizer late in the third, but San Jose still lost its third straight game. Marty Havlat also scored and Antti Niemi made 32 saves.
Matt Moulson and Logan Couture each scored in the first round of the shootout, and then Miller stopped three straight shots before Hodgson beat Niemi for the winner.
The third period was filled with excitement with the teams combining for five goals starting when Ennis scored Buffalo's second road power-play goal of the season to make it 3-2.
But the Sharks erased that lead in a flash.
The first goal came when Joe Pavelski won a faceoff to Marc-Edouard Vlasic, whose shot deflected toward Kennedy, who knocked it in for his second goal of the season 3:19 into the period.
Then just over a minute later, Hertl took a rebound of Scott Hannan's shot and skated around the net for a wraparound goal that was his ninth of the season.
The Sabres appeared on their way to a rare win when Tallinder scored midway through the third and then they had a two-man advantage later in the period. But Jamie McBain hit the post during the 5-on-3, and the Sharks tied it late in the period shortly after a penalty to Marcus Foligno ended.
Wingels dove into the crease to knock in the loose puck to tie the game and excite the sellout crowd.
What appeared to be a decided mismatch on paper between a Buffalo team that had one regulation win all season, and a San Jose team with just one regulation loss was anything but on ice. The Sabres overcame an early deficit and scored twice in the second period to take a 2-1 lead heading into the third.
The first goal came off a San Jose mistake as Jason Demers and Kennedy had trouble clearing the puck out of the defensive zone, and Stafford capitalized, beating Niemi with a quick wrister to tie the game early in the second.
Just seconds after Kennedy and Johan Larsson were sent off for fighting midway through the period, Zemgus Girgensons won an offensive zone faceoff from Andrew Desjardins. McCormick got the loose puck and beat Niemi with a wrist shot between his pads to give Buffalo the lead.
Miller took over from there with stellar play on a pair of power plays late in the second. After Wingels hit the crossbar with a nifty shot from the side of the net, Miller got his pad on Justin Braun's rebound attempt to preserve the lead.
The Sharks predictably scored first with good pressure from Couture's line paying off with a goal midway through the first period when Havlat backhanded a loose puck in front of the net off Miller and in for his first goal of the season. That ended Miller's shutout streak against the Sharks at 139 minutes, 22 seconds and 88 straight saves.
It also marked the 15th time in 17 games that the Sabres allowed the first goal. They have been outscored 21-2 in the opening period this season, while the Sharks have outscored opponents 20-8.
NOTES: Tallinder has scored in consecutive games for the first time since January 2006. ... The Sabres had allowed the first goal in 15 of 17 games.