The route names are flashed on the front of the bus. These links should tell you about the routes.
http://www.mibus.com.pa/rutas/
http://www.panatrans.org/#/
But I have seen many stops with several different long queues, no signage at all, and wondered how people know which line is which. Like most things in Panama, I'm sure it's asking and word of mouth and experience.