Olen Zellweger and Zach Benson scored, and Owen Power had two assists for the Sabres (5-4-3), who were 0-1-2 during their skid and had lost six of their past eight (2-3-3). Tage Thompson had an assist in his 500th career game with Buffalo.
"I thought we had a lot bigger commitment to making sure some shots didn't get through," Ruff said. "When you start seeing that desperation to keep the puck out of your net, you start winning games."
Yaroslav Askarov made 38 saves for the Sharks (6-6-1), who have lost two in a row.
"Yeah, we're not generating, but we also just give up 40 shots and a lot of chances again, so that's the bigger issue," San Jose coach Ryan Warsofsky said.
Sharks defenseman Michael Kesselring had three shots on goal in 16:25 of ice time in his first game against his former team. Kesselring was acquired from the Sabres on June 17, along with a first-round pick (No. 27) in the 2026 NHL Draft, for the No. 20 pick in the draft.
"It was hard,” Kesselring said. “It was hard in the first. It was pretty emotional, honestly, for me tonight. I thought in the second and third, I really started to get it going. Obviously, personally, I wanted to show that they made a mistake, but we didn't win, and that's what really matters."
Zellweger gave the Sabres a 1-0 lead just 50 seconds into the second period. The defenseman raced into the offensive zone on the left wing, and his wrist shot from the top of the left face-off circle beat Askarov by the blocker.
"I still had energy. That was a pretty big gap so I just joined the play there,” Zellweger said. “You want to try to create and be a threat against every team in the League."