One can indeed see the sun rise over the Pacific and set over the Atlantic from Panama.
Most people think that the country is simply a fairly straight strip of land running roughly North-West to South East. In fact it meanders around especially in the vicinity of the canal. The south of Panama is formed by the Azuero Peninsula and this projects into the Gulf of Panama (part of the Pacific Ocean). This land has a coast facing directly east and so the sunrise seen from that coast would be rising over the Pacific. The north coast of Panama faces the Caribbean Sea (a branch of the Atlantic Ocean) and from the coast near the towns of Colon and Portobelo the sun can be seen setting. In fact the canal itself runs in a direction which is contrary to the "lie of the land". It runs from south east (the Pacific side) to the north west (the Atlantic side) when most people expect it to run from south west to north east.
I've been through the Panama Canal in a small passenger boat (rather like a Thames riverboat) taking around 100 passengers. We started from the Pacific side near Panama City and after reaching the Atlantic side returned from Colon to Panama City (where we were staying) by coach. The canal is a truly impressive feat of engineering. Panama is a steamy tropical country with truly amazing scenery, plant and animal life.
This map explains the apparent conundrum:
http://www.worldatlas.com/webimage/countrys/namerica/camerica/lgcolor/pacolor.htm