The giant planet orbiting τ Boötis (named τ Boötis b) was amongst the first extrasolar planets to be discovered. It is one of the brightest exoplanets and one of the nearest to us, with an orbital period of just a few days. Over the course of more than a decade, measurements of its orbital inclination have been announced and refuted, and have hitherto remained elusive. Here we report the detection of carbon monoxide absorption in the thermal dayside spectrum of τ Boötis b. At a spectral resolution of ~100,000, we trace the change in the radial velocity of the planet over a large range in phase, determining an orbital inclination of 44.5° +/- 1.5° and a mass 5.95 +/- 0.28 times that of Jupiter, demonstrating that atmospheric characterization is possible for non-transiting planets. The strong absorption signal points to an atmosphere with a temperature that is decreasing towards higher altitudes, in contrast to the temperature inversion inferred for other highly irradiated planets. This supports the hypothesis that the absorbing compounds believed to cause such atmospheric inversions are destroyed in τ Boötis b by the ultraviolet emission from the active host star.