Rich Hickey's "Hammock Driven Development" is a great talk regarding just this, for anybody who hasn't seen it.
I personally find this is one of the most effective ways of cracking a difficult problem. It's amazing what your subconscious is capable of.