The opacity of a highly compressed hydrogen gas is calculated by considering both the free-free and the hound-free transitions. The electrons are assumed to move in an average potential field of spherical symmetry. For a very dense case such that all the hydrogen atoms lose their electrons by pressure ionixation, the problem is solved by assuming that the medium consists of ions imbedded in a highly degenerate Fermi-Dirac electron gas. The wave functions are determined by a simplified self-consistent field calculation. For density such that only one bound level exists, the broadening of the level due to the presence of the neighboring atoms is obtained by a method similar to that used in the theory of solids. The wave functions obtained from the self-consistent field calculation are then used for determining the opacity.