Train tickets in Spain can be purchased online, in advance and with a credit card from outside Spain. This allows you to take advantage of the advance fares that can be a great deal less than the standard fares.
Special fares: Fares marked with a "star" or "W" are estrella and web fares only. These have the greatest discounts
BUT you can only book them one way. IE if you book a return it will change the return fare to the standard rate.... Of course you can still book two seperate singles at the special rate in two seperate transactions

Website:
www.renfe.esIn the
1st page choose from the drop down menu the
two stations between which you want to travel, The
dates and the
"num Viajeros" number of passengers. Mark Ida y Vuelta for a return ticket or Ida for a one way ticket.
A pop up window will appear.Here you can choose the trains you wish to reserve.
Select each.If you want an open return mark the small box that says
"vuelta abierta"Enter the graphic code.press
"Continuar""datos del Comprador" - purchasers details
Here you need to add the details for each person travelling.
correo electronico - email
Nombre - 1st name
Apellido 1 - 1st Surname
Apellido 2 - 2nd surname
Tipo de documento - select "Passaporte" (Passport)
Numero documento - Passport number
Poblacion - City
Provincia - State / County
Telefono 1 - Telephone
Pais - country
You have to mark the square that says "He leido y acepto las...." terms and conditions.
"Selecion su forma de pago" - Choose your payment method
Tarjeta (credit or debit card)
Numero de tarjeta - Card number
Fecha de Caducidad - Expiry date MONTH / YEAR (mm/yy)
Titular de la tarjeta - Cardholder name (AS IT APPEARS ON THE CARD)
Hit
"COMPRAR"Next window:
You will be presented with a booking reference and an advice telling you that you need to collect your tickets from the window marked
"Recoger billetes" in the station of your departure. This is only necessary the 1st time you make a purchase, afterwards you will be able to use the self service machines in stations to collect your tickets.