The full-back became the seventh free agent to agree terms with the club this summer and joins Cammy Bell, Nicky Law, Jon Daly, Nicky Clark, Steven Smith and Arnold Peralta on the list of incoming recruits.
They will all join Ally McCoist's squad subject to registration once the 12-month transfer embargo comes to an end on September 1.
Foster, 27, joined the Gers for the whole of the 2010/11 campaign on loan from then Scottish Premier League rivals Aberdeen in what was Walter Smith's final one in charge.
He made 24 appearances in the SPL-winning season but returned to Pittodrie before leaving for Ashton Gate in January 2012.
The Scotsman made 51 appearances for the Robins in total before agreeing to end his contract a year early.
Foster told RangersTV: "The fans here expect a certain level of performance and expect to win every game. Hopefully I can bring something to the team in that respect.
"When I first came down here from Aberdeen the last time, I did get my eyes opened a bit and I realised just how big the club was.
"Now, already knowing what the fans are like and everything else too, I understand what to expect.
"The league is the most is the most important thing for us this season but the cups are massive for us too.
"We want to see how well-equipped we are against the bigger teams and last year was a bit disappointing in that respect so we'll be looking to do better this year."