General manager Jeff Gorton announced the moves Wednesday.
Fast, who won his second straight Players' Player Award for team play this past season, got a three-year contract worth $1.85 million annually. Desharnais received a one-year contract worth $1 million.
The 25-year-old Fast skated in 68 games this past season, with six goals and 15 assists. The Swede finished third among Rangers forwards in hits (99) and ranked fourth among the forwards in blocked shots (44).
Fast, who is expected to be sidelined for five months after hip surgery in early June, has skated in 216 NHL games and collected 22 goals and 43 assists.
Desharnais has played in 453 games over parts of eight seasons with Montreal and Edmonton, with 81 goals and 173 assists. The Laurier-Station, Quebec, native split this past season between Montreal and Edmonton, with six goals and eight assists in 49 games.
Desharnais has played in 51 NHL playoff games with four goals and 13 assists. He skated in 13 playoff games with Edmonton, with one goal and three assists.