What determines the shape of lightning? Everyone's seen lightning streaks, either in real life or in pictures and videos. 
My question is, why does it look the way it does? Does lightning spread in a random manner, or is there physics behind the path lightning streaks trace in the sky?
$\hspace{175px}$
 A: Lightning is a form of electric current, so it will find the path of least resistance to the ground, where there is the least amount of negative charge. To get there, the lightning has to travel through part of the atmosphere, but not all air has the same amount of conductivity.
The electric current takes the path of least resistance, or where the conductivity is greatest, so that it can reach the ground with the optimal path. If the entire atmosphere had a uniform conductivity, lightning would be a straight line, perpendicular to the ground. Since regions with high conductivity in the air are random, the lightning appears jagged. 
Here's a source going deeper into why that is: https://www.scientificamerican.com/article/why-are-lightning-bolts-j/
A: Your assumptions are right. There is indeed physics involved in lightning shapes.
Why can’t lightning just be in a plain, straight shape?
From the Indiana Public Media's Moment of Science Podcast episode "The Shape of Lightning Bolts":

The answer has to do with the complex way a lightning bolt forms.
Although it looks like it forms all at once, a lightning bolt is
actually produced in many steps. Instead of jumping right to the
ground, the cloud’s negative charge begins with a short downward hop.
This initial hop is called a “leader,” and it’s no more than a few
hundred feet long. From the lower end of this leader, another leader
forms, and from the lower end of this, another. In this manner, the
negative charge hops downward from leader to leader like a frog
jumping from lily pad to lily pad across a pond.
While this is going on, the ground sends up its own chain of shorter,
positively charged leaders. It’s only when these two chains meet,
about a hundred feet off the ground, that we see the lightning bolt’s
flash.
Lightning is jagged because each leader forms independently of the
others. Each place a lightning bolt zigs or zags is where one leader
stopped and another one started.
Each place a lightning bolt forks is where two separate leaders formed
from the bottom end of a single leader above. This whole process takes
only a few thousandths of a second, but that’s enough time to sculpt
beautiful and complex lightning bolts.

Fun fact: Lightning is actually 5 times hotter than the Sun's "surface".
A: This may not be a fully comprehensive answer as I’m not a physicist, but there are three major points to consider:


*

*Lightning, as with other forms of electric current, in a simple system will have the greatest magnitude along the path of least resistance (more complex systems/circuits show that electricity may flow equally amongst many paths)

*Electricity is the simultaneous flow of electrons or positive & negative charged particles

*Electricity isn’t it’s own phenomenon, but is actually grouped with magnetism into their unified field of electromagnetism


These points being said, we know that with enough energy in a vacuum a bolt will be produced. We also know that air can be a conduit as seen by static electricity or in plasma lamps, but the molecules and charges within it also offers some resistance.
I only have fundamental level of understanding through a series of physics courses, so any true physicist should correct this is comments: 
I believe elements of the system are altered even due to one bolt of electricity. It changes the charged particles in the system, so the offshoot bolts find a greater charge elsewhere. Other factors, like the culmination of weather, heat, sound, and magnetism/gravity also causes shifts in air and other charged (and neutral) particles, which also effects the charges and the resistance path. Furthermore, electrons repel one another, which introduces another variable, causing other paths to develop, even if those paths initially had more resistance. 
One side note: the lightning bolt that people often see is the one that originated from the ground to the sky and not the top-down as one might think.
