C -----> C-E-G
F -----> F-A-C
G(7)---> G-B-D(F)
so you can play C major but
you also can play G major over G chord and F major over F chord
but remember the notes that change for example G major: G-A-B-C-D-E-F#
as you see only change F to F#
and for F major: F-G-A-Bb-C-D-E-F
as you see only a few notes change and you can play any of these notes over the chords just don play notes that crash with the notes of the chords like F# over F chord :( unles you are using them like pasing notes (fusion jazz or weirdiets styles)