The meseta and Ebro basin have a continental climate: scorching in summer, cold in winter and dry. Madrid regularly freezes in December, January and February and temperatures climb above 30°C (86F) in July and August (locals describe it as: nueve meses de invierno y tres de infierno - nine months of winter and three of hell). Valladolid on the northern meseta and Zaragoza in the Ebro basin are even drier, with only a little more rainfall per year than Alice Springs in Australia. The Guadalquivir basin in Andalucía is only a little wetter and positively broils in high summer. This area doesn't get as cold as the meseta in winter.
The Pyrenees and the Cordillera Cantábrica backing the Bay of Biscay coast bear the brunt of cold northern and northwestern airstreams, which bring moderate temperatures and heavy rainfall (three or four times as much as Madrid's) to the northern and northwestern coasts, including cities like A Coruña. Even in high summer you never know when you might get a shower. The Mediterranean coast as a whole, and the Balearic Islands, get a little more rain than Madrid and the south can be even hotter in summer. Barcelona's weather is typical of the coast, milder than in inland cities, but more humid.
In general you can rely on pleasant or hot temperatures just about everywhere from April to early November (plus March in the south, but minus a month at either end on the northern and northwestern coasts). In Andalucía there are plenty of warm, sunny days right through winter. In July and August, temperatures can get unpleasant, even unbearable, anywhere inland (unless you're high enough in the mountains). Snowfalls in the mountains start as early as October and some snow cover lasts all year on the highest peaks.