Both teams had chances in the second 45 minutes, but it was Pedro that grabbed a third for Spain in the 95th minute as an understrength La Roja team recorded an impressive win.
© Getty Images
Bosnia enjoyed plenty of the ball in the early stages, but it was Spain that took the lead in the 11th minute of action when Nolito bent one into the top corner via the crossbar.
Nolito was flying and had his second eight minutes later when he simply lifted the ball over Begovic from inside the box after the Bosnian defence had stepped off the Celta Vigo attacker.
Bosnia's hopes of recovering were not helped in the 22nd minute when their skipper Edin Dzeko was forced off with an injury and only a smart save from Begovic stopped Aduriz from making it 3-0 moments later.
Bosnia were back in the match in the 29th minute, however, when strong work from Edin Visca forced a corner and Spahic was up from the back to head past Sergio Asenjo from inside the box.
Spahic went from hero to zero in first-half stoppage time, however, as the Hamburger SV centre-back was given a red card for raising his hand into the face of Cesar Azpilicueta.
Both teams had chances in the early moments of the second period, but Milan Djuric could not beat Asenjo from close range, before Pedro slipped and fired wide of the post down the other end.
Bosnia again came close again in the 55th minute through Izet Hajrovic, but the number 20 sent his effort wide of the post during what was an end-to-end period of the contest in Switzerland.
Haris Duljevic hit the post with a dangerous cross 25 minutes from time as Bosnia continued to threaten an equaliser, before the same player forced a smart save from Asenjo with a low, curling effort.
Having entered in the second period, youngster Mikel Oyarzabal almost scored a third for Spain on his debut 15 minutes from time, but the Real Sociedad attacker placed his low effort wide of the post.
Denis Suarez also came close for Spain in the latter stages, but Sead Kolasinac was across to make a fine challenge. La Roja were not to be denied a third though as Pedro finished from close range in the 95th minute after Begovic had kept out an effort from Inaki Williams.