It is no cheaper to rent a car when you are in Spain than booking it on the internet before you arrive.
The best thing to do is to visit several car hire websites and compare prices.
Here is a selection of Car hire companies who operate in Spain.
With the bigger companies you can pick up a car from one place and drop it off in another.
Amigo autos
http://www.amigoautos.es/
Avis Car Rental -
http://www.avis.com
Hertz Car Rental
http://www.hertz.com
Alamo Rental Car - Official Site
http://www.alamo.com