In the following example, the B locrian mode is used over a Bmb5 functioning as a 2 chord in the key of A minor. Modes can be used equally well in both major and minor keys.
The Harmonic and Melodic minor scales can also be split up into modes to create lines specific to all the scale tone chords in minor keys. To learn about this, see Progressive Complete Learn to Play Jazz Guitar Manual.