Let $X$ be a differentiable manifold. Let $\mathcal{O}_X$ be the sheaf of $\mathcal{C}^\infty$ functions on $X$. Since every stalk of $\mathcal{O}_X$ is a local ring, $(X, \mathcal{O}_X)$ is a locally ringed space. Let $Y$ be another differentiable manifold. Let $f\colon X \rightarrow Y$ be a differentiable map. Let $U$ be an open subset of $Y$. For $h \in \Gamma(\mathcal{O}_Y, U)$, $h\circ f \in \Gamma(\mathcal{O}_X, f^{-1}(U))$. Hence we get an $\mathbb{R}$-morphism $\Gamma(\mathcal{O}_Y, U) \rightarrow \Gamma(\mathcal{O}_X, f^{-1}(U))$ of $\mathbb{R}$-algebras. Hence we get a morphism $f^{\#} \colon \mathcal{O}_Y \rightarrow f_*(\mathcal{O}_X)$ of sheaves of $\mathbb{R}$-algebras. It is easy to see that $(f, f^{\#})$ is a morphism of locally ringed spaces.
Conversely suppose $(f, \psi)\colon X \rightarrow Y$ is a morphism of locally ringed spaces, where $X$ and $Y$ are differentiable manifolds and $\psi\colon \mathcal{O}_Y \rightarrow f_*(\mathcal{O}_X)$is a morphism of sheaves of $\mathbb{R}$-algebras. Is $f$ a differentiable map and $\psi = f^{\#}$?