Bridging is an excellent exercise for strengthening your gluteals and your core muscles. If you round your back or overarch your back you can cause increased pain. A good technique involves keeping your back neutral and straight and also your pelvis level. You can progress by using one leg at a time or holding on one leg.
If you have difficulty or pain performing this exercise, you might have weakness or muscle imbalance that need to be addressed.