Ice and stretch. Depending on the cause, usually, ice pack calms the muscles in spasm. Gentle stretching is the second best to follow. But if pain persists refer to your physician.
Exercise. Generally, a core conditioning program with gentle strecthing, cadio routines and exercises emphasizing core strengthening in addition to keeping a lean body mass and avoiding fatigue. Habits such as smoking have a significant negative impact on the spine. If not contraindicated, medication such as tylenol, (acetaminophen) Naproxen or Ibuprofen can help as well asa back support along with heat and/or ice.