A couple additional points to keep in prospective.
Every 'scale' has modes, what's been discussed here is only the 'Diatonic scale' the simplest of next to the pentatonic.
Within the scope of Diatonic some modes work well over other keys. The most commonly abused is Lydian over Ionian.
Always keep in mind if your playing C Ionian, D Dorian, E Phrygian, F Lydian, G Myxolydian, A Aolian, B Locrian ....IT'S ALL THE SAME NOTES.
So what if you want to play Lydian over Ionian? Example C, C Lydian is actually nothing more than the key of F..that's it, nothing fancy.
Beyond this in time, you'll want to focus on the chord, not a mode. Especially in vamps using embellishment the rules will change for each movement, example progression where Amaj7 goes to Amin7 goes to Amin7b5 goes to A7b9b13, you'll find modes just making things too complicated to 'think about' while playing. Focus on the chord and what it contains.