The Hammers, having topped their group, didn't have to play in the round of 32 play-off round, which saw the eight teams that finished second in the group stage paired with the eight who finished third in their Champions League groups.
Rangers will host the Serbian champions at Ibrox on March 10, with the return a week later.
Giovanni van Bronckhorst's men saw off competition favourites Borussia Dortmund with a 6-4 aggregate win on Wednesday for one of the most famous nights in the club's history.
West Ham, winners of Group H and so one of the seeded teams, will play Sevilla.
David Moyes' men have reached the last 16 of the Europa League for the first time while Sevilla have won the tournament a record six times and on four of their last five appearances.
Seville will host the final on May 18 at the Ramon Sanchez Pizjuan Stadium.
You can look at the draw in full, below…
Rangers vs Red Star Belgrade
Braga vs Monaco
Porto vs Lyon
Atalanta vs Bayer Leverkusen.
Sevilla vs West Ham
Barcelona vs Galatasaray
RB Leipzig vs Spartak Moscow
Real Betis vs Eintracht Frankfurt