Many patients with migraine  find that the medication they take for their migraine attack will relieve the pain completely or at least take it down to a mild level within 2 hours. It this is not happening with your acute migraine medication, you need to talk to your doctor about trying other medications.
Some patients find, however, that even though their acute migraine medication works well after they take it, their migraine pain comes back again anywhere from 4 to 24 hours afterwards. This is called a headache recurrence. When this happens, the best thing to do usually is to take another dose of the same medication that was taken in the first place. For example, if you took ibuprofen or a triptan (like sumatriptan ) for your migraine attack, a second dose on the same day is fine, and will usually take care of the headache recurrence.
If you are having a recurrence of your migraine on a regular basis within 24 hours of your initial successful treatment, there are several things you can do to make this happen less often. These include:
1. Take your acute medication earlier in your migraine attack while the pain is still mild. If you have frequent migraine attacks, you will need to be careful with this because if you take a non-steroidal anti-inflammatory  drug like ibuprofen or diclofenac on more 15 days a month or more, or a triptan or a combination analgesic (a tablet with several different ingredients in it) on 10 days a month or more, you are putting yourself at risk for more and more frequent headaches (medication overuse headache). Keep a diary to see on how many days a month you are taking your acute medications, and if you are becoming at risk for medication overuse headache, talk to your doctor about other options.
2. You can change your acute medication to one that has less chance of a headache recurrence happening. If you are taking a triptan, switching to eletriptan or frovatriptan may result in less headache recurrence. If you are taking a non-steroidal anti-inflammatory drug like ibuprofen, switching to naproxen sodium, which stays in the body much longer, may help.
3. If you are taking a triptan and having a lot of headache recurrence, taking naproxen sodium along with your triptan (at the same time) may help reduce the number of headache recurrences that you experience.
4. Finally, if you have quite frequent migraine attacks (more than 3 a month), and most of them tend to recur within 24 hours after initial successful treatment, you might consider talking to your doctor about starting on a migraine preventive medication. This does mean taking a medication daily, but preventive medications do not cause medication overuse headache. Once you are on them, the attacks that still occur are often milder and respond better to acute medications.
It is likely that one of the solutions listed above will solve your problem. If not, talk to your doctor about other options.