Simon Burrell, 37, of Gloucester Road, Chesterfield, and Daniel Smart, 25, of Martins Lane, Old Tupton, appeared at Chesterfield magistrates' court on Friday.
Gillian Foxcroft, prosecuting, said it is alleged Mr Burrell's Vauxhall Astra was following Mr Smart's Renault Megane on Brimington Road on the evening of March 3.
She told the court a driver's dashboard camera filmed them 'driving close together'.
Ms Foxcroft said the vehicles went around a slight right-hand bend then Mr Smart allegedly 'lost control of his car, went into the opposite carriageway and hit a bus'.
Ms Foxcroft said the Crown Prosecution Service alleges racing and excessive speeds.
Defender David Metcalfe said Mr Burrell denies driving dangerously and insists he was not involved in the collision.
Julie Page, defending Mr Smart, said he disputes driving at excessive speed but accepts his vehicle collided with the bus and would accept a charge of driving without due care and attention.
The men were released on conditional bail and will stand trial at Chesterfield magistrates' court on September 5.
•The crash resulted in a number of injuries among passengers and the bus driver.