Rice grabbed his second European goal in as many matches as West Ham won their first ever home group-stage match and made it two wins from two.
Said Benrahma grabbed a second in stoppage time to wrap up another victory.
West Ham had a let-off in the second half when German referee Tobias Stieler gave a penalty after Rapid sub Marco Grull went down under a non-challenge from Ben Johnson, with VAR correctly overturning the decision.
And Benrahma made sure it was goodnight Vienna when he cut inside and curled in the second in stoppage time.
Rapid coach Dietmar Kuhbauer said: “You can never be happy after a loss but we played a good game, especially in the second half. Overall a decent performance.”