The 37-year-old will join the outfit, in the second tier of American soccer below the MLS, at the start of the 2015 season in April, also taking on an additional role as technical advisor for the club's youth academy.
Real's all-time leading Champions League scorer is quoted by BBC Sport as saying: "Everyone throughout the soccer world knows the Cosmos name and the legacy of the players that played for this team previously.
"They helped establish soccer in America and I'm honoured to follow in their footsteps. I believe in this club's vision and I'm excited to be a part of it."
Raul won six La Liga titles, four Spanish Super Cups, and three UEFA Champions League titles in his 16 years at the Bernabeu.