From Panama City, you can get to Bocas del Toro by overnight bus to Almirante (10-11 hours), then boat/ferry to Boca.
Start at Albrook Bus Terminal (Gran Terminal de Transporte, www.grantnt.com). And from there you can get your bus to Almirante.
Overnight buses from Panama City to Almirante depart at 8 p.m. and 8:30 p.m and take around 10 to 11 hours. Busses are air conditioned, modern and have reclinable seats. You will arrive to Almirante between 6 a.m. and 7:30 a.m.