I know this has happened to me plenty of times (even on picture day once!:/), and it is always really annoying.
Well the first tip Elle gave was to not pop the pimple. I know that is the first instinct most people have, but it can actually cause irritation. This will bring even more attention to the zit because it will be red and just plain nasty-looking.
She also said to apply a spot treatment to the pimple. Because I know nothing about this, here is the link to her blog post: http://www.elleandblair.com/post/skin-survival-guide-hows-zit-going.
Finally, you could always just cover up the zit so that people don’t notice it as much. One way is the put concealer on the pimple on make sure it blends in with your skin. After you put on the concealer, put a powder over it and your entire face. (I don’t recommend using a liquid foundation for this because it could ruin the effect of the concealer. Additionally to this technique, you could also draw attention to a different part of your face. For example, Elle said, “if the pimple is on your chin—wear a neutral (preferably matte or satin) lip color paired with a darker eye look to draw attention away from the spot and toward the eyes.” However, if the zit is on your forehead, wear neutral eye makeup and a bold lip color. Some good bold lip colors for this would be dark pink and red.