Wolverhampton’s Aaron Rai played himself into contention at the BMW PGA Championship at Wentworth, despite a setback at the end of his second round.