go back to where the rancor came out of. There will be a cut scene, and you will be home free.
Next time you play through, just get the rancor away from the door it came out of, and run in behind it, it will try to get into the little cave thing to get you, but the door will fall onto it's head, a la Luke vs Rancor in Return Of The Jedi
The very existence of flamethrowers proves that some time, somewhere, someone said to themselves, "You know, I want to set those people over there on fire, but I'm just not close enough to get the job done." -George Carlin