Well, If you're a layperson there's no rule against it. Plain and simple. The Buddha never made a rule prohibiting the lay person observing the 5 precepts from engaging in masturbation.
From a Dhamma perspective: The process of masturbation and sex relys upon desire, specficially sensual desire.
What is said about sensual pleasures?
From my understanding it is that partaking in sensuality, reinforces sensuality in the future.
To cut it short: It's habit forming, and that habit won't make you happy.
The drawbacks of sensuality are that it binds us to the sensual world, it causes attachment. Craving for sensuality is one of the things that binds one to the wheel of suffering. Furthermore, the pleasure gained from masturbation, or any sensuality for that matter - Is fleeting, inconstant, it is only for a brief time. Why partake in something that offers you only brief pleasure, when far greater happiness awaits, practising the Noble Eightfold Path.
Here is the index of Sutta's relating to this topic:http://www.accesstoinsight.org/index-su ... sensuality
The sutta's would much better elucidate what I am attempting to convey to you. I also hope you can forgive me for being such a hypocrite. It's one thing to see the truth (however dusty my eyes are), it's another to practise it. I have to admit; I am just as bound to sensuality as the next man. From it, I can say one thing though - It's caused me much more grief than pleasure...
"But, Udāyi, let be the past, let be the future, I shall set you forth the Teaching: When there is this this is, with arising of this this arises; when there is not this this is not, with cessation of this this ceases." - Majjhima ii,32
Nanavira Thera's teachings - An existential approach to the Dhamma:http://bit.ly/LDsGHg