Timetables are here:
http://thomasallen.home.sapo.pt/travel/001.htm
The most important points to note from that website seem to be:
(i) you can't buy tickets on the day of travel ; and
(ii) when reading the timetables, remember that Portugal is in the same time zone as the UK but Spain is one hour ahead, on Central European Time.
Chris