Whether bareback riding hurts a horse depends on the horse's training, the rider's skill, the horse's conformation, and the ride's duration.
A well-trained horse with an experienced rider is less likely to experience discomfort. Use a pad, start with short rides, and stop if the horse shows signs of distress.