If it happens when you shut the door, it's probably a loose connection on the speaker itself ... failing that, it could be a fault in the wire where it goes through the rubber tube between the doorpost and the door ... try the speaker end first...
unlikely that it's anything major or expensive to fix ... a squeeze with a pair of pliers, or a piece of tape on a bare wire could cure it..
If you're really unsure, pop it to Halfords, they have Car Audio 'experts / fitters' at their stores