Most of the time the bass or deep, bass-like sounds/voices are used as the basis for the sound of a piece. They provide the tonal foundation that the rest of the voices refer to. As a part of the rhythm section, it contributes to the rhythmic pulse of the piece. But the bass can do more than that.

For example: If you’re stuck for a connecting section or want to mix up your arrangements with something different, consider using the bass as a melodic instrument.

Depending on which bass sound you are using, you can add some sparkle on top and make the melody more easily discernible by combining the bass with a high-register instrument.

I have found that doubling the bass melody with instruments like flute or glockenspiel makes for a pretty and interesting sound.

Some examples

Listen to the bass and flute sharing the melody at 0:54 and bass and guitar at 1:16
Bass and Glockenspiel share the melody at 0:54
The Bass is the main lead instrument from 4:36-5:15
Bass-Synth, Lead-Synth and Musicbox, spread over several octaves, are the main lead instruments from 4:30-4:45
Here’s a completely synthetic example from 8:01-8:19

Even without using the bass as the main melodic instrument, it can also be used as a more equal part of the “ensemble”, as bass players like Paul McCartney, Phil Lesh or Chris Squire among others have shown. But that is a topic for maybe another time.