Here are three tips for explaining an employment gap:
1. Be honest and upfront. Trying to lie or bluff your way through isn't the way to do things, and to be perfectly honest, most good hiring managers will see straight through you. Explain the circumstances of the gap in an honest and straightforward manner.
2. Think outside the box. If you're between jobs and you're worried it'll end up being an extended gap, consider doing voluntary work. This will give you something recent to put on your resume. You should also consider taking relevant courses. This shows you are an ambitious individual who is always looking to improve their skill set.