A lot of different aircraft have vertical or near-vertical fins below the empennage, or above the empennage and attached to the front of the vertical stabilizer.
What purpose do these devices serve?
The vertical tail surface is like a wing, maybe with a smaller aspect ratio, but it works much the same over sideslip as a wing works over angle of attack. The fuselage, however, is a slender body with a much smaller lift curve slope, but a much higher "stall" angle. In fact, its lift curve slope is nonlinear and tends to increase with higher angles of attack and angles of sideslip. If you want to know more how the lift curve slope varies with aspect ratio, please read this.
This means that at some sideslip (around 15° for most configurations) the vertical tail stalls and its stabilizing side force decreases with further increase in the sideslip angle, whereas the destabilizing influence of the fuselage increases further. The aircraft becomes laterally unstable pretty soon.
To buy a little more stability around the point where the vertical tail stalls, these strakes have been added. They have a high leading edge sweep, so they will produce vortex lift just like a highly swept delta wing, only sideways. The suction force of this vortex will act on the root of the vertical, just were it has the biggest chord. In fact, this helps to keep most of the vertical active, because now it becomes part of that delta wing ahead of it.
The strakes in the upper picture have a different purpose on top, however. They limit flow separation on the rear fuselage in high speed flight by preventing crossflow. Actually, they are an embarrassment for the aerodynamicist, because they show that the lower fuselage suffers from flow separation just when it hurts most.
Most military cargo aircraft have them, because in order to keep the ramp short and to provide enough clearance for rotation, their tailcones are steeper than what the airflow can manage. Among modern military transporters, only the Lockheed C-5 (thanks to @dotancohen for the hint!) and the Antonov-70 can do without them. This was a definite source of pride for the chief aerodynamicist of the Antonov Design Bureau, Oleg Bogdanov.
The lower fin in the second picture was added to compensate the destabilizing influence of the two floats, which will destabilize the aircraft in much the same way as the fuselage does.
Extending the vertical downwards also helps to improve handling qualities and should be done as much as tail strike clearance allows.
Strakes serve to improve lateral stability in airplanes which may have certain features that make them less stable in yaw.
For example, strakes are especially popular on floatplanes, and, indeed, the Floatplane Flying Handbook says:
On many airplanes, directional stability is affected to some extent by the installation of floats. This is caused by the length of the floats and the location of their vertical surface area in relation to the airplane’s CG. Because the floats present such a large vertical area ahead of the CG, they may tend to increase any yaw or sideslip. To help restore directional stability, an auxiliary fin is often added to the tail. Less aileron pressure is needed to hold the seaplane in a slip. Holding some rudder pressure may be required to maintain coordination in turns, since the cables and springs for the water rudders may tend to prevent the air rudder from streamlining in a turn.
There are also STC kits that add strakes to different airplane, and whose manufacturers claim a variety of improved handling benefits, including "Increased Yaw Stability."