I would suggest that Madrid is a better option, at least from a traveling perspective, especially if you are doing a return flight. The train/bus from Barcelona to SJPP will involve more changes, and less options. Have look at
Alsa (buses) and
Renfe (trains) for possibilities. People seem to think that Paris is a great option, especially after watching the movie " The Way", - might be easier to start, but sure is more cumbersome to finish (unless you do open jaw, but that tends to make the ticket double in price).
Tickets for buses/trains are often cheaper if you book them in advance (generally 3 weeks) and as August is peak vacation time in Europe, booking in advance might be a good idea.
Paris is lovely, so is Barcelona - and Madrid. It depends on how many days you have available either side.
I generally only do train/bus in Continental Europe - there are flights, and they can be cheap, but - I like trains/buses. They generally do center of town/center of town. Some flights arrive 80-100km from the city they advertise, which is fine as long as you know...Then - you have to go through the whole security process. Get to town center, move to the other airport - then move 80-100km to next airport. I'd rather take a bus. Have a look at your options