Veteran midfielder Gavin Rae is to return to Dundee next season for a third spell with the Dark Blues.