Consider the following chord progression:
G F#m G F#m G F# ...going on with G again...
1 measure each chord
The melody is in key of D (at least until F#)
Soloing over this progression requires me to choose notes from a different scale over the last chord F# to avoid unpleasant tones. I tried this in 3 different ways. I considered the F# section as:
F# major, using all the relative tones
B major, centering the phrase on F#
C# major, centering the phrase on F#
However I noticed that only the second option really sounds good although in theory even options 1 and 3 are possible. What could be the reason?
I think the fact that F# chord act as sort of secondary dominant (V/vi resolving on G that is IV) could impose the use of F# Mixolydian (i.e. option 2), but I leave the word to you.