The Real Madrid forward was on target twice to give Chris Coleman's side a winning start in Group B, though Arsenal midfielder Ramsey picked up a knock later on.
With two automatic qualification spots and one playoff place up for grabs in each group, Wales has rarely had a better chance of reaching a major tournament for the first time since 1958.
But Chris Coleman's side suffered an early scare after falling behind against an Andorra team looking to add to a meager tally of five points from 82 qualifiers since being ratified as a FIFA nation in 2000.
Their hopes were thwarted by Bale, though, as the Real Madrid winger scored twice - his winning effort a curling a free kick that came just nine minutes from time to spare Wales' blushes in the Group B clash.
Captain Ildefons Lima scored the hosts' first competitive goal in four years early in the first half by converting a penalty to give Andorra, ranked 199th in the world, hope of claiming only the second competitive victory in their history.
Bale soon leveled with a header and, just when it appeared that Andorra was going to hold on for a famous point, the 25-year-old produced a moment of quality that broke the underdogs' hearts and served as another example of why Real paid a world-record transfer fee for his services.
The visitors enjoyed the better of the opening exchanges but surprisingly fell behind in the sixth minute through Lima's spot kick.
Center back Lima stepped up to convert from 12 yards after Neil Taylor had been dubiously adjudged to have brought down Ivan Lorenzo.
Wales immediately reassumed its dominance as it pressed to find a quick leveler, with Bale offering a warning sign as to his threat in the air as he headed narrowly over the crossbar from Joe Allen's corner.
Andorra did not learn from that near-miss, though, and was punished by Bale after 22 minutes when he towered above the home defense to glance home Ben Davies' perfectly placed left-wing cross.
But Coleman's men were far from impressive going forward and only when Bale got into promising areas were they really able to trouble a surprisingly resolute Andorra defense.
Bale forced a good save from Ferran Pol with a curling free kick 12 minutes into the second half before seeing an excellent cross headed wide by striker Andy King.
The opportunities continued to come for former Tottenham star Bale, who saw a header acrobatically cleared off the line by midfielder Josep Ayala in a fitting demonstration of Andorra's heroic defensive effort.
Yet that effort proved to be for nought as Bale fired home from a set-piece at the second time asking after seeing his first effort saved by Pol, only for the referee to demand a retake due to encroachment in a costly error by Andorra striker Gabi Riera.