The magnetoencephalography (MEG) aims at reconstructing the unknown neuroelectric activity in the brain from the measurements of the neuromagnetic field in the outer space. The localization of neuroelectric sources from MEG data results in an ill-posed and ill-conditioned inverse problem that requires regularization techniques to be solved. In this paper we propose a new inversion method based on random spatial sampling that is suitable to localize focal neuroelectric sources. The method is fast, efficient and requires little memory storage. Moreover, the numerical tests show that the random sampling method has a high spatial resolution even in the case of deep source localization from noisy magnetic data.