How do sharks and other fish conserve and gain water in marine environments?
The mechanisms of osmoregulation is different for sharks (and other elasmobranch fishes) and teleost fishes. 

In Elasmobranchs the body osmolarity is maintained equal to the seawater by Na⁺ Cl⁻ and urea. Toxicity because of high concentrations of urea (strong chaotrope) is counteracted by high levels of trimethylamine oxide (TMAO). So, the elasmobranchs do not need to drink water to prevent dehydration. But sometimes they do drink water for adapting to different salinity levels [1]. 

Teleost fishes, however, need to drink water in order to prevent dehydration. Initially Na⁺ and Cl⁻ are absorbed in the esophagus via cotransporters (Na-Cl/Na-K-Cl), thereby reducing the osmolarity of water. The cells that absorb Na⁺ maintain its low concentration by pumping extra Na⁺ in the Extracellular fluid, using Na⁺/K⁺-ATPase. Cl⁻ is also exchanged with Bicarbonate (HCO3⁻) via anion exchangers [2]. 

.