Jem and Scout make their way toward home in Chapter 28 of the novel. In this chapter, the children are assaulted by an unknown assailant. Scout is unable to see or identify the attacker because of her ham costume (which she wore in the school's pageant). She also does not understand exactly what takes place during this episode.
...the real hero—who is not revealed explicitly at this time—is the one who assists them in the scuffle after the pageant.
Later, it becomes clear that Boo Radley kills Bob Ewell to save them from the attack. Initially both Scout and Atticus believe that Jem is the one who killed Bob Ewell. Logic, however, prevails. Heck Tate realizes that Jem did not kill Ewell with a kitchen knife. Boo Radley did, with a knife he brought to the scuffle from his own home.
In the final pages of the book he shows especial courage in rescuing Jem and Scout from the violent Bob Ewell and allowing Atticus and Heck Tate to decide the consequences.
Heck Tate covers up for Radley with a series of lies. The knife that he uses to perform a mock up of the events that took place where Ewell was killed is said to be from a drunk. Tate also says that Ewell accidentally stabbed himself.
In rescuing Jem and Scout, Boo Radley risked his prized privacy as well as risking arrest for murder. Tate takes a risk of his own in covering for Radley.
Each of these risks are undertaken parallel to the risk that Atticus Finch takes in defending Tom Robinson. Doing the right thing, in this novel, often means accepting the threat of personal danger.