Inexpensive, relatively comfortable buses make daily trips from southern Mexico, Guatemala , Honduras , El Salvador, Nicaragua, and Costa Rica  to Panama. This is, obviously, quite a long haul—nearly four solid days from the Mexico-Guatemala border, including two overnight stays in El Salvador and Nicaragua.
Two bus companies, Tica Bus and Panaline, make one daily trip between Panama City and San José, Costa Rica. Both leave from the Gran Terminal de Transportes, Panama City’s main bus terminal in Albrook.
Try to make reservations at least a month ahead of time during the dry season and on holidays. At other times, booking about four days ahead of time should be fine. Reservations can be made by phone or email, but they must be bought in person at the Albrook bus terminal, with cash. Travelers can check two pieces of luggage and take one carry-on at no extra charge.
Transport is by large, long-haul air-conditioned buses with toilets and reclining seats. The trip costs US$35.10/US$70.10 one-way/round-trip on either line and takes about 16 hours, which usually includes a lengthy stop at the Paso Canoa  border crossing to go through immigration and customs, as well as a half-hour or so break in Santiago, about halfway across Panama, where travelers have access to a cafeteria, restaurant, pharmacy, ATM, and other services.
Note: Costa Rica time is always one hour behind Panama time. Times listed here are all local.
Tica Bus (Panama City tel. 314-6385, San José tel. 506/222-8680, www.ticabus.com ) leaves from the Albrook bus terminal at 11 a.m. daily, arriving on Paseo Colón in San José around 4 a.m. the next day.
The bus from San José to Panama City leaves at noon daily, arriving at Panama City’s Gran Terminal de Transportes at 4 a.m. the next day.
Panaline (Panama City tel. 314-6383, San José tel. 506/256-8721) leaves from the Albrook bus terminal at 10 p.m. daily, arriving in San José around 3:30 p.m. the next day. The bus drops off passengers in San José, 200 meters north of Hospital San Juan de Dios, near Terminal Coca Cola. Note that this is a rough part of San José.
Buses from San José leave from the same spot at 1 p.m. daily and arrive around 5 a.m. the next morning at the Albrook bus terminal.
A third bus company, Agencia Tracopa (David tel. 775-7269 or 775-0585, Paso Canoa tel. 727-6581, San José tel. 506/222-2666), has one bus departure from David  to San José daily, at 8:30 a.m. The trip takes about eight hours and costs US$12.50.
Theoretically, one could make the trip to or from Managua in a brutal 30 hours or so either way, including a layover of just an hour or two in San José if timed right. Trips to or from El Salvador, however, require an overnight stay in Nicaragua, and trips starting or ending anyplace farther north require overnight stays in both Nicaragua and El Salvador.
Travelers must find their own accommodations, so consider booking rooms ahead of time. Passengers are free to break their travel anywhere and catch a bus on another day, but they must book reservations ahead of time for the onward journey. The longest trip, between Mexico and Panama, costs around US$120 one way.