I deal with writer's block by trying to prevent it in the first place. I accomplish this by keeping ideas in reserve until subsequent writing sessions. For example, if I have a good idea about a scene, or perhaps character dialogue, instead of incorporating it all in the story in one writing session, I will end my writing session before exhausting the idea. This helps me to have something to begin with during the subsequent writing session. This tends to keep the story flowing. I've found that once the story is flowing, new ideas tend to come easier, so that it becomes self-perpetuating.
Another thing that is important to me is a thorough preplan or story outline, including allowing time for the story to develop in my mind before I actually begin writing drafts. Also, my first drafts are written quickly and from my emotions, as if I'm feeling the story as I write it. While this results in a rather choppy first draft, it makes it easier to write subsequent drafts. This tends to keep my mind occupied with the story as a whole, and when ideas come to mind, I simply incorporate them.