Avoid notes: The pitch or pitches of a chord scale which are not used harmonically because they will destabilize the sound of the chord.
This already clears up the first misunderstanding that avoid notes should be avoided altogether. That's not the case, they are used melodically, e.g. as passing tones or neighboring tones. When playing a solo melody, avoid notes can (and probably should) be used, but they will usually not be used as target notes which are held out for a relatively long time. They will normally occur as short notes between chord tones or tensions.
The remaining question is: how do you know which notes in a certain scale are avoid notes? The (simplified) answer is: avoid notes are notes that are not part of the chord and that are a half step above a chord tone. The classic example is the fourth scale tone of a major scale. E.g. over a C major chord with the major scale as chord scale, the note F would be an avoid note because it is a half step above the third of the chord (the E). Note that there is no other avoid note in the major scale. I should add that this definition of avoid notes is less accurate than the definition given above. I will provide some counterexamples below.
It is important to realize that whether a note is an avoid note or not is not purely a property of the scale but also of the chord it is played over. Using the example from above, the F in C major is an avoid note when played of a C major chord. However, if you play a C major scale over a Csus4 chord (C-F-G), then the F is a chord tone and therefore certainly no avoid note.
Looking at modes as chord scales over seventh chords made up of scale degrees 1, 3, 5, and 7, it turns out that there a some modes without any avoid notes, some others with 1 avoid note, and one with 2 avoid notes (the numbers below are the scale degrees of the avoid notes):
- ionian (over maj7): 4
- dorian (over m7): none
- phrygian (over m7): 2, 6
- lydian (over maj7): none
- mixolydian (over dom7): 4
- aeolian (over m7): 6
- locrian (over m7b5): 2
From the above list, phrygian has most avoid notes (2), and dorian and lydian have no avoid notes (in all cases interpreted as chord scales over the given seventh chords). Note that if dorian were played over a minor 6 chord, its seventh scale degree would be an avoid note. So, again, whether a note in a scale is an avoid note or not also depends on the chord over which the scale is played.
Finally, it's important to understand that all these definitions which may appear to be rules are just the result of observing how composers and musicians have used certain scales over certain chords (in certain styles). So if it ever happens that your ears are in disagreement with the above 'rules' then trust your ears. Nowadays we are much more accustomed to certain dissonances than listeners were several centuries ago, and how notes are perceived in a certain context changes over time. The most famous exception to the 'avoid note rule' is the b9 tension of dominant seventh chords. The b9 is a half step above the root of the chord, but there are many situations where it can definitely be used harmonically with a dominant seventh chord. Another typical example which sounds especially nice on the guitar is the chord that result when you shift up an open C chord by two frets:
X 5 4 0 3 0 (from low to high strings)
This is a D chord (no 5th) with an added 9 and an added 4. The 4 (the open G string) is actually an avoid note (because it's a half step above the chord tone F# on the D string) but due to the voicing this chord does sound good in certain contexts.
In sum, it's good to understand what an avoid note is, but after having grabbed the concept, it's even more important to understand that there are no strict rules, just conventions, and that avoid notes can always be used melodically, and that in certain situations they can even be used harmonically.