I think you're supposed to take Maalox after eating: http://www.medhelp.org/drugs/Maalox-Anti-Gas/show/1204
. I'm not sure it will work right away, but I think the goal is after taking it a few times, it starts to reduce the acid buildup, which will then help the swallowing. I had an ulcer and was having the same issue. Took about 3-4 days of consistent use and then I could really tell the difference.
Some of them, like Zantac, you do take beforehand. Just depends on the medication.