The quasi-steady migration and deformation of bubbles rising in a wall-bounded linear shear flow are investigated experimentally in the low-but-finite-Reynolds-number regime. A travelling optical device that follows the bubble is used for this purpose. This apparatus allows us to determine accurately the bubble radius, contour and rising speed, together with the distance between the bubble and the wall. Thereby the transverse component of the hydrodynamic force is obtained for Reynolds numbers Re (based on the bubble diameter and slip velocity of the bubble in the undisturbed shear flow) less than 5. The results indicate that in the range 0.5 < Re < 1.5, the transverse force acting on a spherical bubble agrees well with an extension of the theoretical solution obtained by McLaughlin (J. Fluid Mech., vol. 246, 1993, pp. 249–265) for rigid spheres, whereas it becomes larger than the theoretical prediction for Re > 1.5. In the regime in which bubble deformation is significant, the shape of the bubble and the deformation-induced transverse force are determined both experimentally and computationally, using a spectral boundary element method. Both estimates are found to be in good agreement with each other, while the theory of Magnaudet, Takagi & Legendre (J. Fluid Mech., vol. 476, 2003, pp. 115–157) is found to predict accurately the deformation but fails to predict quantitatively the deformation-induced transverse force.