Sulfate/sulfide transformations

Sulfur is another element required for animal life. After carbon, hydrogen, oxygen and nitrogen, the next most common element found in organic molecules is sulfur. Sulfur is a component of some essential amino acids that are part of proteins and of humic substances. You won't be surprised to find a limited arc of the planetary "sulfur cycle," even in the aquarium's little ecosystem, because all the elements essential to life must be recycled, or else biological processes would have exhausted the planet's supply, after a couple of billion years.
Sulfate and sulfide are two faces of the same coin. In the sulfate ion (SO4), a sulfur atom is surrounded by four oxygen atoms: oxidized, in other words. Sulfates are harmless to fish, odorless and quite stable. By contrast, in sulfides, such as hydrogen sulfide (H2S), the sulfur atom is reduced, stripped of its oxygen and joined to another atom. Sulfides are reactive, and they can be quite toxic. Foul-smelling hydrogen sulfide is produced in microzones depleted of oxygen, which would quickly oxidize it to sulfate, if it were locally available. Buried in anoxic substrates that are too rich in organics and too deep, the "killing zone" of an isolated self-sustaining sulfuretum could possibly become established in the aquarium.
Sulfur transformations. Within the aquarium there are sulfur transformations rather than a true completed cycle beginning and ending with elemental sulphur, as with phosphate. As with phosphate, too, inorganic sulfur is unavailable to animals; it must be assimilated by bacteria or plants to form organic sulfur compounds before animals can use it in assembling essential proteins and co-enzymes and other necessary biochemicals. Bacteria break down organic molecules containing sulfur, rendering it in a "mineralized" form that plants can use.
Sulfur transformations, like other elemental cycles represented in the aquarium,  are driven by  bacterial processes. Some bacterial metabolisms can reduce sulfate, stripping it of its oxygen atoms, while others oxidize the sulfide that's produced. The various sulfur-metabolizing bacteria aren't genetically related. They form a co-dependent community, passing sulfur back and forth between sulfate and sulfide states, even sometimes excreting a little elemental sulfur. In undisturbed regions of mature biofilm and the substrate, the aerobic sulfur bacteria help use up the last of diminishing supplies of oxygen, so they keep their anaerobic neighbors safe from the dangerous, reactive O2.
Where is the aquarium's sulfur? At any given moment, most of the sulfur in the aquarium is in the form of sulfates (SO4). Though most of the organic sulfur is in the form of sulfates, not all sulfates are built into organic compounds: sulfates can also be mineralized. Gypsum, for one example, is calcium sulfate, CaSO4: when ground fine it makes plaster-of-Paris, the major component of sheetrock and those weekend "feeder blocks" embedding food flakes. Sodium sulfate, the salt of sulfuric acid, is another widely distributed mineral sulfate. Potassium sulfate is only moderately soluble, but you might be adding it as a plant fertilizer, for its potassium component. Magnesium sulfate is more familiar as Epsom salts. Aluminum sulfate is the alum you might occasionally use to clarify water.
Sulfate is the form of sulfur plants can use, and like phosphate it can only re-enter the food web through algae and plants. They take it up and convert it into their characteristic proteins, which may be consumed by animals, who can't use sulfates directly; instead they convert these plant-produced amino acids into their own animal proteins.
The death of plants or animals begins the process of decomposition, communal processes that involve cooperating fungi and bacteria. The decomposers break down animal and plant proteins, releasing amino acids that animals can use or "mineralizing" the amino acids, that is, breaking them down all the way to release the sulfates, which algae and plants take up once more.
Sulfide (SO), stripped of oxygen, is the other form of sulfur normally involved in biological processes: hydrogen sulfide is the most familiar species. 
Thiosulfates (SO3)  are a less common form of sulfur. You know them most likely from sodium thiosulfate, the active ingredient in de-chlorinator. Thiosulfates don't last in the aquarium, because bacterial communities metabolize them, further oxidizing them to sulfate (SO4). 
Sulfur bacteria in the substrate. A Winogradsky column would demonstrate more clearly than the aquarium itself how in the undisturbed substrate there are communities of sulfur bacteria, playing various metabolic roles. Their combined effect is to oxidize sulfides to sulfate. Some sulfur bacteria photosynthesize, though in a nutrient-rich sediment, heterotrophic bacteria may overwhelm the slower-growing phototrophs.
Sulfur is much less common in freshwater sediments than it is in marine environments. Typical freshwater habitats for sulfur bacteria are lake sediments and intertidal mudflats. In such sediments sulfur bacteria communities form densely-populated mats (denser than cyanobacterial mats) that are confined to the narrow layers where the oxygen and sulfide gradients overlap.
Sediment banding. Distinct layers also form in sandy sediments— which are more like most aquarium substrates than mud sediments are. Bands in an undisturbed substrate form in reaction to four chemical gradients: light, oxygen, sulfate and sulfide. On the interface between water and substrate, diatoms coat most surfaces, mixing with cyanobacteria. The diatom layer protects the cyanobacteria beneath from the corrosive effects of oxygen. On a mud substrate this community might form a thin dense, somewhat slimy mat: a biofilm. Just below, purple bacteria (with bacterial chlorophyll a), lie in a layer just above green sulfur bacteria (with bacterial chlorophyll b). Purple and green bacteria are the phototrophic "non-sulfur" bacteria of freshwater sediments, especially in alkaline environments. In the layer where silica sand transmits some light, especially in the infrared range, "blind" but motile sulfur bacteria exist in permanent symbiotic relations with phototrophic green sulfur bacteria that cover them. Phototrophic sulfur bacteria require the simultaneous presence of reduced inorganic sulfur compounds— diffusing upwards from anoxic layers— and light coming from above. They get their carbon from CO2. Green sulfur bacteria have two distinguishing colors, bright grass green and chocolate-brown, arising from phototrophic pigments.
Photosynthesizing sulfur bacteria. Anaerobic photosynthesizing sulfur bacteria sometimes form distinct dark layers in the substrate next to the tank glass, where daylight hits it. The bacteria involved are purple sulfur bacteria (with red, brown, purple and orange photosynthetic pigments) and, usually beneath them, the olive-green to brown green sulfur bacteria. In anoxic environments, these bacteria are able to metabolize sulfide or elemental sulfur, using a primitive and ancient kind of archaic photosynthesis that doesn't produce any oxygen. Very low levels of light will suffice for them.
On one of my tanks (and yet not on others), beginning a half-inch below the substrate surface, there's a clear-edged area that is black-green, perhaps dense with these sulfur bacteria probably mixed with cyanobacteria. My hunch is that these particular photosynthesizers are discouraged by the oxygen in the topmost gravel layer. What has been mysterious to me was, why does this photosynthesizing zone appear equally strongly in gravel that's not exposed to daylight from a window? Then RTR explained this phenomenon well in an AC post, 3 Dec 2002: "A significant part of this may well be only on those sand grains or the glass itself exposed to internally relected light. Light from the tank's lighting entering the glass at certain angles passes through the interior glass surface, but is reflected back from the exterior and comes back out within the tank just below the substrate surface— the glass itself acts a light pipe for a short distance. In one small area, pull back or siphon up the sand. If the algae is still there in the glass with a bit on the sand removed, it is just internal reflection promoting growth, and it may be removed at will. If the patch extends into the tank away from the glass a completely different process is occuring."
Link. I'm getting some of this information from Jörg Overmann's rather technical but perfectly readable document, "Diversity and ecology of phototrophic sulfur bacteria" in Microbiology Today, Aug 2001, archived at the Society for General Microbiology's site. If it might be more than you want to know, check the abstract for a quick view.