This thesis is devoted to the theoretical study of the transition towards the amorphous solid state. Amorphous solids can be divided into two categories: those that undergo the so-called glass transition at finite temperature, and those that undergo the so-called jamming transition, without any thermal fluctuations. We study a model system of spherical and frictionless particles interacting via a finite range, mildly repulsive pair potential: the harmonic spheres. Studied at finite temperature, it models structural glasses, and undergoes a glass transition. Studied at zero temperature, it also allows to investigate the jamming transition. These two phenomena, which are a priori distinct, are sometimes thought to be related, the jamming transition supposedly being the zero temperature manifestation of the glass transition. Two theoretical approaches coexist in the study of the glass transition: mode-coupling theory, which describes the slowing down of the dynamics of glasses upon approaching their glass transition, and the random-first-order transition theory, which focuses on the long time behavior of the system by making hypotheses on the distribution of its metastable states. For a given class of mean-field disordered systems, these two approaches can be reconciled, but the situation in finite dimension, which this thesis is about, leaves a large number of questions unresolved. We first present a theoretical approach of the dynamics of glasses which allows us to clarify the approximations implied in mode-coupling theory, and gives a solid starting point to go further. We then study the links that can exist between the two approaches described above, and show that at least a part of mode-coupling results is contained in the static approach of the random-first-order theory, while providing a starting point that would permit to improve the latter. Finally we study harmonic spheres at very low temperature and develop a microscopic theory of its jamming transition, that captures a large set of numerical and experimental observations. We show that, within our approximations, the glass transition and the jamming transition are two separate phenomena.