The scenario you described corresponds to Newton's third law of motion. Newton's third law states that for every action, there is an equal and opposite reaction. When you bump into your friend while riding the bumper cars, your car experiences a force pushing against your friend's car. As a result, your car bounces back in the opposite direction due to the reaction force.