For instance:
E minor= E F# G A B C D E
IF the song's chord progression contains the chords of the scale, than you play that scale.
example: some song goes: E G A F# G E
All those chords are contained in the E minor scale, there fore play e minor, or something that works well in the same situation.
that was a piss poor explanation