Most of Spain will be exceedingly hot in July. Northwestern Spain, however, is much cooler, wetter, and greener. The Mino/Minho valley along the Portuguese/Spanish border is very nice, and eastward when the river is entirely in Spanish territory is a lovely vineyard region. I second the suggestion about the Picos de Europa. There is a gorge area in a valley on the north side of the Picos which was great for cycling.
In SW France, the Dordogne valley east of Bordeaux and its tributary the Lot river have some of the best cycling you can find anywhere.