If your rocking out a solo over a chord, a good solid place to start is with one of the notes that exists in that chord. Take the G major as you stated. The G Major chord is made up of the notes G, B, and D. So starting it off with any of those notes would give you a
solid starting point. That's not always what you want though. A good way to approach this since your looking for a rock solo. Take the most commonly used scale for rock music, the (major)pentatonic scale. In G major it's made up of G, A, B, D, and E. As you can see G, B, and D are already meantioned. So try playing an E over the G major and see if you like that. Usually if you start with a major 6th above a major chord (E is a major 6 above G), the solo will generally lean towards a minor sounding solo. Basically because E is a minor chord in the G major scale, and actually its relative minor. The other note "A" will produce alittle more tension. If that's what you want that's the note for you, but it's not commonly used as a starting point but rather a pivot point to the next chord. The only thing I can tell you is try all the notes over the G major until you find the right one. Remember it's should always sound good first and only you know what you want.
Also try playing C# over the G major chord. This is whats known as the lydian note (#4). I think you'll like the sound. Hope that helps.
"My whole life is a dark room...ONE BIG DARK ROOM" - a.f.i.