what is the best way to travel from madrid to lisbon
Easyjet will fly you from Madrid to Lisbon for ~$45-50. Exact fare will depend on your travel date. Flight takes 1 hour 20 minutes.
As stated, air would be your best option. The train systems of Spain and Portugal are not will connected or coordinated so that could take some time. There is a bus option that would work if you want to stop off along the way and maybe take two or three days. Spanish buses are excellent.
There is a daily direct night train connecting the two cities. Journey time is about 9 hours, you will be sleeping through most of it, and saving the cost of a hotel room. Head over here for more details: http://www.seat61.com/Portugal.htm#via%20Madrid