Pair programming in small doses, works wonders. One to three hours working together on a problem can see serious productivity gains. There's no magic to this however; Any collaborative environment gravitates towards this sort of activity naturally.
As with most things, balance is necessary. Some solitude to think and reflect, some collaboration to explore your ideas and some pairing to smooth out the rough spots.