The 35-year-old, who has an average of 38.28 in 61 Tests, replaces Azhar Ali, who has returned to play in Pakistan.
Somerset sit two points off the lead in Division One and face Yorkshire and Hampshire before a potential title decider against leaders Essex.
In three games for Essex at the end of last season, Vijay made three fifties and one hundred in five innings.
“I am excited about the challenge of trying to help Somerset push for the County Championship,” Vijay told the club’s website.
“Somerset have an excellent reputation and I am looking forward to being a part of what they are trying to achieve.”