emphasied text
We are planning to spend time in Lisbon and than want to go to Barcelona-I thought there was a night
train to Madrid and on to Barcelona-any help on this.
Look here
https://venta.renfe.com
the Combios Portugal CP.pt site says: buy your ticket from Renfe
I'd investigate flying; check for flights on Skyscanner. Night trains can be uncomfortable, though I have no experience with that one. I see that the night train makes 14 stops between Lisbon and Madrid, 8 of them occurring between midnight and 8 AM. Will you sleep through all that stopping and starting and noise? And the trip takes 14 hours. Flying would be so much faster and quite possibly cheaper. The countryside between Madrid and Barcelona is mostly not very exciting.
Here's a detailed look at the route. It's over 14 hours with numerous changes. And unless you have a couchette it will be uncomfortable as well. I love rail travel, especially in Europe. But in this case, I'd definitely find an inexpensive flight from Lisbon directly to Barcelona.
I'd fly too, but if you do want to hear from a train advocate, look at rail guru The Man In Seat 61. Here's his page on Lisbon to Barcelona: http://seat61.com/international-trains/trains-from-Lisbon.htm#Lisbon_to_Barcelona