This question is asked alot. What I have come to find is that it is really more about the chord progression than the scales.
Check it out...
The first thing that we need to know is what key the song is in and if it is major or minor. This is the first application of scales. Here you will decide which scale you want to use. Typically it will be Ionian or Lydian for major. Dorian or Aeolian for minor (of coarse this is not in stone but it will work for the basics of most songs). What you have to remember here is that the major or minor refers to the chord not the scale. The bassline will revolve around those chords and the notes in which ever scale you choose to match that chord.
The point is yes learn your scales but even more importantly understand how the chords are spelled out (arpeggio's).
I will try to break this up into parts to keep it simple and not too long and confusing. Hope this helps someone. Pt. 2 "Other Scale Usage".