There is no direct bus service from Pamplona to Lagos.
Rail
There is a train leaving Pamplona at 19.40 arriving Vitoria-Gastiez at 20.45
There is a daily overnight train (Sud Express) leaving Vitoria-Gastiez at 00.15 arriving at Gare Oriente, Lisbon, Portugal the next day at 10:54.
There is a train at 13:20 from Gare Oriente, Lisbon, Portugal arriving Tunes Junction at 16:49. There is a connecting train arriving Lagos at 17:01.
Bus
This would involve a Bus or Train from Pamplona to Madrid Est. Sur, then a bus/train to Seville and then the twice daily DAMAS/EVA bus from Seville to Lagos.
For train times see the site of Spanish railways www.renfe.es and Portuguese railways www.cp.pt.
For bus from Seville to Lagos see:
http://thomasallen.home.sapo.pt/travel/001.htm
You may find some of the links on the right hand side of my blog useful.
See:
http://barlaventostravelblog.blogspot.com/