Posting your year, model, engine always helps so we don't have to guess.
But my guess will be there's probably a little water down in the body of your distributor. Next time it won't start, pop the cap and rotor off, spray some WD40 down into the body of the distributor and soak up the excess with paper towels. Clean the cap and rotor with the WD40 and wipe them off as well. Re-install, see if she starts. If so, your cap may not be seating well on the distributor (if it's a Vortec then the screw tabs may be cracked, very common), also be sure the weatherstrip on the cowl plastic at the rear of the hood is intact.
Richard