I have headaches like that too, some friends think they are migraines but to me pain is pain and headache pain is almost always there. I use ice bags to reduce inflammation in my joints and muscles, I use gentle stretches to reduce the tension too.
One I really like is the pillow stretch. You know when you were a kid helping mom make the bed? You would take the pillow and stick it under your chin? Then pull the pillowcase on? That is a good exercise to stretch out those upper back and neck muscles. Take a thick bed pillow and stick it under your chin and press your chin towards your upper sternum. Slowly and gently this stretches those muscles out. It relaxes muscles that are usually hard to get to move. By getting the upper back muscles relaxed and the blood flowing better you can help stop the headaches before they start.
Another stretch that gets the sternum and upper back is a doorway stretch. Stand in a small doorway, put your hands on the door frames closest to you then lean forward through the doorway. Your collarbones and arm joints will feel this one the most. It's like doing a push up in the doorway. These muscles hardly ever get stretched out. There are lots of exercises that you can find by googling stretching exercises.
One thing that often gets a headache going is not sitting properly when doing something like watching TV, being on the computer, reading a book, etc...if I take a moment and put a small pillow behind my neck or turn it up and down to get it just right to support my upper back and neck then I won't have the neck and back pain. Stopping the tension and muscle tightness is the key to stopping the headaches for me.
Often the pain is associated with inflammation due to the muscles being so stressed and "worked up". I had a physical therapist tell me to take small up to med. size Styrofoam cups and fill them about 2/3 full the freeze them. Water expands as it freezes, learned that on McGuyver, and that makes the water have a dome on the top. When I am feeling a lot of pain in my back and neck I will get one of those cups and peel off the part and expose the dome. I have my husband rub/massage my upper back and neck with the ice and it works and I can feel the inflammation going away. By using Styrofoam he can really get a grip on it and press firmly, the Styrofoam insulates it so his hands only feel cool not cold. I also use those freezer bags made with jell and lean/lay on them to help too. Of course you don't want to freeze the areas so be cautious about the amount of time,no more than a few minutes in one area.
Another thing is using a swimming pool. The cool water reduces inflammation too and helps you relax while you play, swim, etc....