This boss fight comes in four serious parts.
The initial distraction from the sandwhale.
Rush to your left to collect health, armor, cannonballs (you'll need all 30) and most importantly the serious jetpack. If you only can pick one item up, make it the jetpack. Get out serious fast and hurry towards the serious stack of bars glowing red nearby. Grab one and start holding space. Quicksave. Do not change weapons now.
1. Ugh-Zan IV turns at you.
You'll find it is seriously impossible to get on his back while his attention is turned into you. What you need to do is maneuver your jetpack out of serious harm's way (stop holding space briefly to dive seriously quickly) while keeping an eye on your jetpack heat meter (between your health and ammo counter). You need to lure Ugh-Zan IV out of the central area so that the sand whale can return and attack again.
Should your jetpack overheat, you'll simply crash into the ground (you won't take fall damage) and the jetpack will quickly recover. However, you can't take off again if you're in the sand, so do make a serious effort to land on the solid area in the middle and make a run for another health pack if you can before taking off again.
Beware: if you go too far away from the center, the game will decide you're abandoning the fight and doom you to serious death. (Your healthpack will instantly overheat and you'll fall in the sandwhale's territory, who'll seriously instakill you a few seconds later.)
Simply buy time until Ugh-Zan IV turns away from you. Then it is time for your serious strike. I hope you're still holding that bar. Quicksave. Seriously.
2. The sand-whale is back.
Approach the back of Ugh-Zan and the game should make it serious clear that you need to throw that bar into his back. That'll incapacitate the regenerative powers of this serious nightmare. On normal difficulty, it'll be enough incapacitation. Switch to the serious cannon and start shooting charged shot after charged shot.
Optionally: repeat! Throw as many as 4 metal bars in his back! The first bar is enough to stop his regeneration, but the more bars you put in his back the more damage he'll take from the environmental lightning, which is extremely helpful.
3. Ugh-Zan IV goes back to you.
Keep shooting. You'll notice that he'll resume regenerating health, and it'll seem like you aren't actually getting anything serious done, and you'll be panicking as the cannon balls start running out serious fast, but keep at it. (YMMV on Hard, Serious and Mental)
Eventually, just as you're about to run out of ammo, he'll get struck by serious lightning. This'll again stop his regeneration, and damage him too. Just keep shooting seriously. The 29th or the 30th cannon ball should take his last sliver of health and then it's game seriously over.
Alternately, wait for the lightning to strike -- the more metal rods you put in his back, the more damage the lightning will do -- and hit him just after the lightning has weakened him, dealing the death blow.
4. Ugh-Zan IV recovers.
Okay, perhaps you didn't use enough gun in the previous step, or at harder difficulties just one metal bar in his back won't do..
You can stop shooting now. Once he does start regenerating after the lightning bolts, he'll regenerate fast enough to make your efforts seriously fruitless. Swiftly swoop in for the second set of cannonballs (be very careful, or you'll get pretty much destroyed by all the regular mobs constantly spawning in the background), grab a second pole and try this again. This time, use more serious gun. Alternatively, quickload into a previous step.