Zinedine Zidane's team have moved two points clear of both Barcelona and Atletico Madrid ahead of their respective matches against Real Betis and Rayo Vallecano later tonight.
The visitors had a half-chance inside four minutes when James Rodriguez slid a pass in to Bale, but the in-form Welshman could only fire his effort wide of the far post.
James, on his return to the team, continued to impress and came close to making the breakthrough in the ninth minute after being fed by Nacho, but Geronimo Rulli was on hand to make a smart save. Sergio Ramos and Bale then both sent headers just wide of the post as Sociedad struggled to stem the flow of traffic.
The clock hit 22 minutes and Sociedad had hardly been in Real Madrid's half, and the chances continued to arrive for Los Blancos as Bale headed a James cross just wide of Rulli's post.
Teenage striker Borja Mayoral set up another opportunity for Real Madrid in the 26th minute, but James fired his effort straight at Rulli.
Sociedad continued to struggle in the final third as the first period drew to a close, but they were using the ball better and deliveries from both David Zurutuza and Mikel Oyarzabal caused problems to the away side's defence.
Nacho had the best chance of the first period in the 41st minute after breaking into the Sociedad box, but after beating Rulli and poking the ball towards goal, defensive midfielder Mikel Bergara was on hand to clear to safety.
Bale once again came close for Real Madrid early in the second period, with the Welshman heading a Modric corner wide of the post from a narrow angle.
Down the other end, Zurutuza managed to wriggle into the Real Madrid box and unleash a strike towards goal, but Ramos put his body in the way and the ball went behind as it remained 0-0 with 55 minutes on the clock.
Bale had an outstanding opportunity just before the hour when a cross from James fell for the Welshman inside the penalty box, but somehow Rulli made a left-footed save to prevent the first goal of the match.
Zidane introduced Jese Rodriguez 25 minutes from time in an attempt to find a decisive goal, but Sociedad were a threat themselves on the counter as Bruma started to stretch the legs of Raphael Varane and Ramos.
Jese had a chance to send the visitors ahead in the 73rd minute when he found space inside the Sociedad box, but Rulli was on hand to make another smart save.
© Getty Images
Jese then had another opportunity when Bale slid a pass into the path of the Spaniard, but Rulli was quick off his line to collect and keep the score level entering the final 15 minutes.
Bale was not to be denied, however, and headed a Vazquez cross into the back of the net in the 80th minute to ensure that Real Madrid remained firmly in the title race with just two games to play in Spain's top flight.