Generic Cafergot is used for preventing and treating certain kinds of headaches (eg, migraines, migraine variants, "histaminic cephalalgia"). It works by constricting blood vessels in the lining of the brain, which helps to decrease the pain from migraine headaches.
Generic Maxalt is used for treating acute migraine headache with or without aura (flashing lights, wavy lines, dark spots) in adults. It should not be used to prevent migraines or cluster headaches. It works by narrowing dilated blood vessels in the brain, relieving migraine headaches.