Look up MACBA in Barcelona - they usually have something photographic on display. And don't forget to stop by ARPI on Las Ramblas (the mother-ship store near the bottom of Las Ramblas, which is 6 floors, including a mini photo museum on the top floor). They have fliers in a rack by the door with listings of what's going on in photography in Barcelona. MACBA's address: Plaça dels Àngels, 1, 08001 Barcelona, Spain. They're in between the Sant Antoni, Universitat and Liceu Metro stops, probably closest to Universitat.
For Madrid, check up on the Reina Sofia and Thyssen-Bornemisza museums for what's showing - they may have photography exhibits in their temporary galleries. The Thyssen-Bornemisza is on the Paseo Del Prado, a bit north of the Prado and on the other side of the Paseo. The Reina Sofia is a few blocks off the Paseo, at the other (south) end, walking distance from the Atocha Metro station.