A theory for mechanical contact of solids with friction is developed for a wide range of contacting profiles and loading histories. The starting point of the approach is the normal load-displacement dependency that can be obtained via analytical solutions for regular e.g. axisymmetric profiles and via modeling for random surface topologies. Then, the Jaeger elastic principle based on similarity of equations for normal and tangential deformation allows us to obtain the tangential load-displacement relation for simple loading, i.e. for constant normal and tangential actions, and, moreover, to replace rough profiles by equivalent axisymmetric ones. Since in the presence of tangential action a zone of stick and a zone of slip appear in the contact area, the problem becomes memory dependent. An original general scheme of memory organization called memory diagram is presented. Evolutions of memory diagrams are governed by a special set of rules; the solution for a given memory diagram is purely analytical, although sometimes implicit. The range of applications can cover the contact acoustical nonlinearity, solids with cracks and geomaterials, vibrations of objects with partial contact, etc.