Im new to creating solos and i was wondering:

if i played a song in the key of G...
and the chords during the solo were G, C, D...
would i use the scale of G throughout the solo or solo in the g scale then the c scale then the d scales, when the chords change?

please help!!

thank you
For the example you've given, you could use the G scale throughout. Definately what I'd do.

It's the same in most cases, until you start talking about modes.
You could do either, although personally I'd just stay in G. As long as you don't start using chords outside of the scale it will still sound good.
does that apply for all keys and chord progressions or just the example ive given?
For that you have a wide range of scales you can use. During the entire progression you can obviously use G major, and all of its modes, seeing as your playing in G. (E minor and B phrygian would be my favorite.)

Then you can get into the the rocknroll style of breaking theory rules. For example, while playing the G, you can play in G minor pentatonic and blues, and when playing in C, you can play C minor pent. and bles, and when playing the D, you can play D minor and blues.

Correct me if I'm wrong, but can G minor pentatonic and blues also be played over the C chord?
My Gear:
Peavey 6505+
Marshall 1960B
Schecter Hellraiser Avenger
Ibanez VBT700
Marshall Guv'nor
Marshall Echohead
Morley Tremonti Wah
Boss TU-2
Boss NS-2
Avatar 2x12
EHX Holy Grail Reverb
Furman SPB 8C
Boss Flange
You're all going to hate this.

When you play the notes of the G major scale over of of the chords in G major (not G major), you are no longer playing the "G Major Scale." You are playing the corresponding mode. For instance, if you play a lick that contains the notes in G major over B minor, you are playing B Phrygian. This isn't yo say that when you come across a Bm chord in a G major progression (yes, you can have minor chords in major progressions) you have to play at the 7th fret. Remember, a scale is not a position or a box or a fingering. A scale is simply a group of notes.

So yes, you have to change scales when you change chords. It isn't optional, it is just what happens. However, you don't have to make a conscience decision to do so. The degree you emphasize the chord changes is up to you. You can approach that entire solo as if it is just G major, OR you can really emphasize the modal tones of each chords' corresponding modes (ie you would emphasize C over the D chord but to so much over G).

Marty Friedman explains this a bit in his melodic control video.