The mechanical behaviour of continuous media with stochastic damage