We determine the p-rank of the incidence matrix of hyperplanes of PG(n, p e) and points of a nondegenerate quadric. This yields new bounds for ovoids and the size of caps in finite orthogonal spaces. In particular, we show the nonexistence of ovoids in O10+ (2e ),O10+ (3e ),O9 (5e ),O12+ (5e )O+10(2e)O+10(3e)O9(5e)O+12(5e) and O12+ (7e )O+12(7e) . We also give slightly weaker bounds for more general finite classical polar spaces. Another application is the determination of certain explicit bases for the code of PG(2, p) using secants, or tangents and passants, of a nondegenerate conic.