Watching Ron as he opened the wardrobe, Harry remembered Mad-eye Moody ..or what they thought was him, telling them that it was always better to face a boggart in pairs so it didn't know who to frighten first. Obviously it had seen Ron first and decided on that, the spider crawling out was a dead giveaway.
But when it morphed into Bellatrix Lestrange, Harry was just as surprised as his partner seemed to be. Wincing as she shouted at them, he looked at Ron, reaching out and grabbing his arm when he went for his wand. "Don't!" Harry reminded him. "We have to last half an hour. It's not really her."