The Brazilian struck twice after goals from Luiz Adriano and Alex Teixeira to ensure Mircea Lucescu's side are still in the race for a place in the next round
The Brazilian rifled home an unstoppable shot after a quick counterattack just past the hour mark, after compatriots Luiz Adriano and Alex Teixeira had given the hosts a two-goal lead, before heading in a late second.
The win saw the Ukrainian champions move above Bayer Leverkusen and into second place in the group behind Manchester United, whome they face at Old Trafford on December 4.
Both coaches made four changes from the weekend, with Andriy Pyatov returning in goal for Shakhtar after missing Saturday’s 4-0 win over Sevastopol.
The hosts came into the game having not tasted a home defeat since December 2012, and they once again set about asserting their authority.
It took just over 10 minutes for Shakhtar to carve out the first clear-cut opportunity, Teixeira denied by the shins of Sociedad goalkeeper Claudio Bravo.
It was a sign of things to come, with the next five minutes seeing Douglas Costa and Bernard both wasting decent opportunities.
Sociedad had chances of their own within the first 15 minutes, their most notable coming after some slick one-touch passing, which ended with Chori Castro unleashing a tame shot straight at Pyatov.
But it was the Ukrainian side that did much of the probing in the first half and they were nearly ahead 10 minutes before the break when Darijo Srna's free kick cannoned back off the crossbar.
They had more luck two minutes later, though, when Douglas Costa's pinpoint pass found Adriano at the near post, with the latter making no mistake from close range.
Douglas Costa forced Bravo into a fine save late in the half, while Inigo Martinez saw an effort deflected over by team-mate Antoine Griezmann, as Sociedad looked for a foothold in the game.
Shakhtar began the second half with a similar degree of urgency and doubled their lead just before the first five minutes of the half.
A mistake by Martinez was pounced on by Teixeira, who burst into the box before powering past Bravo. Griezmann almost halved the deficit just before the hour mark, but Pyatov tipped his fierce effort onto the post.
However, the win was assured for the hosts 10 minutes later when some neat interplay found Douglas Costa on the left-hand side of the box and the Brazilian then curled a sublime effort into the top corner.
Douglas Costa added a fourth in the dying minutes, getting on the end of a teasing cross from substitute Taison to guide a smart header into the net and wrap up a great night for the hosts.