This paper investigates the technical efficiency of Polish dairy farms producing environmental output using the stochastic ray function to model multi-output – multi-input technology. Two general models are considered. One which neglects the provision of environmental output and one which accounts for such output. The main focus is on the estimation of technical efficiency of farms producing the environmental output. Since some farms do not provide such output at all, the stochastic ray frontier functions are estimated to overcome the problem of the zero valued dependent variables which often occur when the Translog output distance function is used. The detailed results of the technical efficiency analysis show that, although the estimated efficiencies from the models which neglect the environmental output and those which account for the output are rather similar on average, the rankings based on these efficiencies differ.