The option is in Preferences->Playback and Recording
If you're using WASAPI, then pick "WASAPI Shared" as opposed to "WASAPI Exclusive".
If you're not using WASAPI, then checking the "Suspend Audio Engine When SONAR Is Not In Focus" should disable the audio when you switch to other programs (e.g. a browser). Not all audio drivers may respond to this though.
M.