Phase contrast imaging is achieved using a sample mask 8 and a detector mask (6). X-rays emitted from x-ray source (2) are formed into individual beams (16) by sample mask which pass through sample (14) and arrive at individual pixels (12) of the detector (4) through detector mask (6). The individual x-ray beams are arranged to hit the pixel edge (20) of individual rows of pixels, individual columns of pixels or individual pixels. Small deviations &thetas; in the individual beams (16) cause a significant increase or decrease in the signal hitting the exposed area (22) of the pixel resulting in a significant phase contrast signal.