Whew, this is a huuuuuu-ge subject. First of all, I would suggest that you listen to some of the masters at this: Joe Pass, Wes Montgomery, Martin Taylor, Tuck Andress, Jim Hall, Tal Farlow, etc. These cats ( and some others ) are the giants of this genre.
The most important thing to remember is that you need to think like a pianist. The melody note ALWAYS goes in the top voice of the chord. The rest of the chord is the underlying harmonization. So what you need to do is a( learn a boatload of chord voicings primarily on the first four strings, but also the "shell" voicings with fifth and sixth string roots. Learn them for Major, minor, and dominant. There is NO WAY around this, you have to do it. Then b), you must learn how to extend those chords to incorporate the melody note in the top voice of the chord you are playing. For example, if the chord in question is a C minor7, and the melody note over it is D#, then you will want to play a Cminor#9. If the chord in question is say an F Major6, and the melody note is G, then you will need a F Major9.
Not every note needs to be harmonized with a chord. Also, you asked about scales; This is also an exhaustive subject, but it's like any other solo playing. If you are going from C minor to F Major, you could use C Dorian, or C minor pentatonic, C blues, etc, over the C minor, and then you need to work into a F Major scale ( or F Lydian, depending on the context and the home key ).
Two excellent references for this style are "Solo Jazz Guitar" by Bill Hart, and the name escapes me at the moment, but the chord melody book by Jody Fisher is a gem. It is available on his website, www.jodyfisher.com
, or you could get the name of it there and look on Amazon, etc. Good luck; this is, imho, the single most challenging style of guitar to master, and I am certainly not one by any means, but if you can get even half-way good at it, you are light years ahead of your average player.