Darwin's theory for the grazing incidence geometry