Kinetic approach to granular matter in a medium