Ah, yes! This tip from Joe is one of my all time favorite things to meditate on. I especially like to pick voicings from the Joe Pass chord book, and apply this concept to them. I think that the main idea here is associating different sounds with chord voicings, and developing your ear to hear different harmonic possibilities over chords. Also, developing your ability to play horizontally across the fretboard as opposed to linearly up and down the fret board, this way all of the lines you play with this concept in mind are literally right under the chord that you are holding.
All of the answers I read are great approaches and all correct in their own right, but I would recommend to you what I think Joe himself would recommend, and that is to not overcomplicate things. I am assuming that you have a basic understanding of intervals and chord construction since you are working on this. You'll of course also need to have been studying scales on their own, if this is your first exposure to playing scales I'm sure it would be confusing and difficult.
So look at the chord you have, and evaluate the intervals within the chord. Let's use a major 7th chord with the root on the low E string as an example. You look at the chord you are holding and see that you have your root, 7th, 3rd, and 5th. Your 5th is the top note, being played on the B string. So you are going to play a scalular line starting with that root, and ending with that note on top (your 5th). So you already know four of the notes you are going to play, because you are holding those 4 notes in the chord. You have to think to yourself: "Self, what scales contain a major 7th, major 3rd, and a 5th?" There is of course more than one answer. Just as an example, you could choose Ionian or Lydian. I'll pick Lydian since I like the sound of that #4 that the Lydian scale has. So I play the chord, then start on the root and play the Lydian scale up to the 5th (top note of my chord). And there you go.
Although it may not seem like it yet, this is really a straightforward but powerful thing to practice. As for deciding on what scale to play, as others have mentioned I think, you literally can choose ANY scale, since there technically are no "rules" and dissonance is often as desirable a thing as consonance. But to accomplish the objective of developing your ear and the lines that you play over chords, you should choose scales that AT LEAST contain the same intervals as the chord. The intervals that aren't contained in the chord can be free game depending on how out you want to go. For example, that major 7 voicing we played didn't contain a 4th in the chord, which is why I presented Lydian or Ionian as our options. Because both of those scales contain all of the intervals that are in the chord voicing, and the only difference between them is that 4th.
Remember that you need to continually study chord voicings/construction as well as scales in combination with this exercise to really get a lot out of it.
I hope this helps in some way!