Use the arrow keys to throw the soul around. IMPORTANT!!!: You are NOT trying to avoid the bones. The aim is to hit as many bones as possible to destroy the Human. The bar is not an HP bar. It's an Energy bar. It shows how much energy Sans has. If it depletes, Sans becomes vulnerable. Using the act/mercy menus will not protect you from the Human's attacks.
Thanks to SteveTheNarwhal for the battle engine and Toby Fox for Undertale. This is a game where you play as Sans and must give the Human a bad time. 5/19/16 removed a lie in the notes and credits about healing :P