Madrid to Alicante
Quick answer
Take the high-speed train to Alacant Terminal for Alicante city. For a Costa Blanca resort, price the onward leg too.
The long-distance station and the Luceros tram stop are separate. From the airport, the C-6 bus serves both the railway station and connections to the tram.

For Alicante city, search for Alacant Terminal
Alacant Terminal is the long-distance railway station in Alicante. OUIGO quotes about 2 hours 20 minutes from Madrid Chamartín. Renfe’s route information also lists Madrid Atocha, so read the station printed next to your chosen departure. This matters particularly if a friend is dropping you off or you are changing from another train in Madrid. OUIGO Madrid–Alicante · Renfe route details
Going on to Benidorm or another resort
For travel along the Costa Blanca, look up the TRAM d’Alacant journey from Luceros to your destination before choosing the Madrid train. Luceros has a separate entrance from Alacant Terminal. Include the transfer, the wait for the tram and the distance between the final stop and your accommodation, especially with beach gear or a pushchair. Aena guide to the coastal tram connection

When the airport is the better arrival
The airport has coach routes to several destinations. If your resort has an airport coach, price that itinerary alongside the train and tram. For Alicante city, the C-6 airport bus stops at the railway station and connects with the tram at Luceros. On a flight-plus-train trip, that bus is a real connection to allow for. Aena airport buses and stops
Alicante to Madrid
For Madrid, board at Alacant Terminal. If you start in a resort, choose the return tram or coach first and leave time to reach the railway station. Check the Madrid terminus against your next appointment or connection before choosing the departure. OUIGO stations and journey time