If you can see a patch of Desktop, with a program (any program other than Finder) window active, hold down both Option and Command and click that patch of Desktop. This will auto-hide all windows for all other programs and switch focus to the Finder/Desktop at the same time.
This works when going from any active program to another, except that the Desktop itself will not get hidden (open Finder folders will get hidden).
To bring a program's windows back to visible status, just click the program's icon in the Dock. For open Finder windows which are hidden, just click the Desktop (plain click).
If you want to hide the windows of just one program, with it the active program hold down just the Option key and click in the window of another program (the Desktop or a folder window counts for this purpose). All windows of the original program will be hidden, and focus will switch to the second program.