For medical imaging problems, computer scientists Pizer and Eberly introduced the "core" as the analogue for grayscale images of the medial axis. It is defined for two-dimensional images as the "ridge" of a "medial function" defined on (2 + 1)-dimensional scale space. In this paper, we extend methods from singularity theory to analyze the generic properties of ridges and cores for two-dimensional images, including the generic transitions which occur for sequences of images varying with a parameter such as time. We do so by placing the ridge construction into a larger "relative critical set structure," which captures properties undetected by the disjoint ridge/core segments. The genericity properties are established using transversality conditions for associated mappings. We introduce a method for establishing transversality conditions for medial functions obtained by Gaussian blurring by using a basis of local solutions to the heat equation. The method applies to many other properties besides those we consider. Furthermore, establishing genericity via transversality conditions implies the stability of the full structure in any compact viewing area of scale space under sufficiently small L-2 perturbations of the image intensity function.