how many days will you have? Do you already have your tickets?
If you fly to Barcelona, I would plan at least 2 days, maybe 3 there. From there you can take a train to Valencia. I would allow at least 2 days in Valencia.
From Valencia I would probably hop on a plane to Malaga - Vueling has cheap flights. Then in Malaga I would probably spend 1 day in the city and 1 day in Granada. (You can purchase day trips to Granada easily from Malaga) From there you have to get back to your departure city which will be???? Madrid? You can take a fast train from Malaga to Madrid, or again a cheap flight.
You can take a train easily between: Malaga, Seville, Madrid, Cordoba; between Barcelona - Valencia; Baracelona-Madrid,
I took a bus from Valencia to Denia and spent a week there because I had a timeshare. Not much to do there though. I then took a bus to Salobrena - another coastal town, not much there again, but I enjoyed my stay, from there I took another bus to Nerja. I really like Nerja and am now here for a month. Between Valencia and Malaga there isn't a whole lot but small towns. Only worthy if you have the time, if you just want to hit the hot spots, you don't have time to wander around.