In the first part of the poem, the highwayman rides up to the inn where Bess, the landlord's daughter, lives. He kisses her at her window before riding off for "a prize." As he is a highwayman, we can assume that the "prize" he is referring to is money that he is planning to steal from some travelers. Before he leaves Bess, he promises that he will be back "before the morning light." He says he will find a way back to her even if "hell should bar the way."
In the second part of the poem, a troop of red-coats arrives at the inn. "Red-coats" was the derogatory name for British soldiers during the eighteenth century. These soldiers tie Bess to her bed, and two of them kneel at her window with rifles in their hands. We can infer that the soldiers are using Bess as bait to catch the highwayman. The plan seems to be to shoot the highwayman when they see him riding toward the window to return to Bess.
Later in the poem, Bess hears the highwayman returning. She somehow manages to untie one of her hands and proceeds to shoot herself in the head. She does this hoping that the highwayman will hear the gunshot and ride away and thus avoid capture by the red-coats. She gives her life for his. The highwayman hears the gunshot and turns away from the inn. He does not know at the time that the gun fired was fired by Bess, nor does he know that Bess is dead.
When the highwayman, the following morning, finds out that Bess is dead, he tries to return to her. He rides back to the inn "like a madman," with "his rapier brandished high," and is shot dead by the red-coats. He dies on the highway, in a pool of his own blood.