Fish are all heavier then water due to skeletons and other tissues containing heavy elements. Fish must find some way of staying buoyant in the water column, unless they are bottom feeders. A shark for example must be continually moving forward, yet they are aided in buoyancy by large livers, which contain a fatty hydrocarbon with a density less then water. Yet, the most effective means of buoyancy is the swim bladder, in which all bony fish posses. .
This swim bladder apparently arose from lungs on primitive fish, which were needed for such drastic wet and dry seasons in the Devonian era. Fish must continually be adjusting there swim bladders in order to prevent over-inflation or under-inflation caused by differences in water pressure at varying depths. There are two ways in which fish are able to adjust the gas volume, the first being a pneumatic duct which connects the esophagus to the swim bladder. Fish containing these types are limited to shallow depths as they can only change their swim bladder by taking gulps of air from out of the water. Fish which are considered more evolved have a mechanism in which gas must originate in the blood and be secreted into the swim bladder. This gas exchange depends on two specialized areas. The first being the gas gland, which actually secretes gas into the bladder and the second is the resorptive area which removes gas from the swim bladder. This gas gland is supplied by a network of capillaries known as the rete mirabile, this network traps gases and prevents loss to the circulation. .
The gas gland excretes lactic acid, which enters the blood, causing localized high acidity in the rete mirabile that forces hemoglobin to release its load of oxygen. The capillaries in the rete are arranged so that the released oxygen accumulates and eventually enters the swim bladder.