The same players combined again for Betis, but Molina's curling effort hit the inside of the post.
It was end-to-end football and the hosts squandered a good chance to take the lead when Agirretxe powered his header just wide of the post.
Andersen was called into action just before the break, tipping away Carlos Vela's effort.
Antoine Griezmann missed a chance to give Sociedad the lead, flicking an effort past the post, and then Agirretxe had a shot saved by Andersen.
However, it was 2-1 soon after. A corner found Jon Ansotegui and the defender powered his header into the net.
The home side extended their advantage with just over an hour played. Vela found Griezmann at the far post and the Frenchman slotted in from close range for his 10th league goal of the season.
The match was then put beyond Betis when Agirretxe thumped in a powerful effort for his second goal.
There was just time for a fifth as Xabi Prieto converted at the back post.