Welshman Thomas finished third in Friday's 18km time trial on the third of five stages in Portugal.
Switzerland's Fabian Cancellara won the stage in 20 minutes 57 seconds while Germany's Martin finished second, five seconds back, with Team Sky's Thomas a further 23 seconds adrift.
Previous leader Luis Leon Sanchez withdrew from the race after crashing.
Following Saturday's 194km stage for the sprinters, the race concludes with a 196km race and summit finish in Malhao on Sunday.
Martin, who is more renowned as a time trial specialist, has won the race twice before but Team Sky sport director Gabriel Rasch told the team's website: "We're in a good place now - especially with the last stage and the mountain-top finish.
"It's a climb we know well and everything is possible. Hopefully we will have a straightforward day on Saturday and then the guys are ready to go on the offensive."
Movistar lead the team classification ahead of Martin's Etixx-Quick Step team.
1. Tony Martin (Ger/Etixx-Quick Step) 9hrs 22mins 17secs
2. Geraint Thomas (GB/Team Sky) +3secs
3. Ion Izagirre (Spa/Movistar Team) +20secs
4. Tony Gallopin (Fra/Lotto Soudal) +46secs
5. Thibaut Pinot (Fra.FDJ) +47secs
Geraint Thomas is three seconds behind leader Tony Martin as he attempts to defend his Volta ao Algarve title.