I'm not sure that it is possible to generalize that much...
First of all, in rock songs, you will find a lot of bands playing with 2 guitarists and 1 bassist. So as @Wheat Williams said, the bass line is often played by the bassist in rock songs. But then, there is usually one lead guitar, who will play a melody line and one rhythm guitar, who can be seen as the riff player. This is the most usual band organization.
But you can find A LOT of different organizations in rock songs! Sometimes the lead guitar can be replaced by a trumpet, a sax ... Or the rhythm guitar can be replaced by a keyboard.
Finally, even if bands have a lead guitar and a bassist, it's not mandatory for them to respect the theory above. For instance, it can happens for a lead guitarist to play the "rhythm line" while the bassist is doing the melody, as it can be happening while you are playing piano.
So I'll definitely say that it's a matter of context, that will depend on the aim of the band on doing something common or more creative.