Error-correcting pairs were introduced independently by Pellikaan and Kötter as a general method of decoding linear codes with respect to the Hamming metric using coordinatewise products of vectors, and are used for many well-known families of codes. In this paper, we define new types of vector products, extending the coordinatewise product, some of which preserve symbolic products of linearized polynomials after evaluation and some of which coincide with usual products of matrices. Then we define rank error-correcting pairs for codes that are linear over the extension field and for codes that are linear over the base field, and relate both types. Bounds on the minimum rank distance of codes and MRD conditions are given. Finally we show that some well-known families of rank-metric codes admit rank error-correcting pairs, and show that the given algorithm generalizes the classical algorithm using error-correcting pairs for the Hamming metric.