Here's a lightning bolt
decoration. It's not hugely customizable as it stands, as all the dimensions of the bolt are determined by the distance between the two points:
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{decorations}
\pgfdeclaredecoration{lightning bolt}{draw}{
\state{draw}[width=\pgfdecoratedpathlength]{
\pgfpathmoveto{\pgfpointorigin}%
\pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength*0.6}%
{-\pgfdecoratedpathlength*.1}}%
\pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength*0.55}{0pt}}%
\pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}%
\pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength*0.4}%
{\pgfdecoratedpathlength*.1}}%
\pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength*0.45}{0pt}}%
\pgfpathclose%
}%
}
\begin{document}
\begin{tikzpicture}
\foreach \i [evaluate={\p=rnd*75+25;\q=rnd*75+25;}] in {1,...,50}
\fill [yellow!\p!orange!\q!blue, decoration=lightning bolt, decorate]
(rand*4, rand*4) -- ++ (rand*180:rnd*4+2);
\end{tikzpicture}
\end{document}
And here is a lightning bolt to
path:
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{calc}
\tikzset{lightning bolt to/.style={to path={
let \p1=(\tikztostart), \p2=(\tikztotarget), \n1={veclen(\y2-\y1,\x2-\x1)} in
(\p1) -- ($($(\p1)!0.6!(\p2)$)!\n1*.1!-90:(\p2)$) -- ($(\p1)!0.55!(\p2)$) --
(\p2) -- ($($(\p1)!0.4!(\p2)$)!\n1*.1!90:(\p2)$) -- ($(\p1)!0.45!(\p2)$) --
cycle (\p2)% Move to end point
}}}
\begin{document}
\begin{tikzpicture}
\foreach \i [evaluate={\p=rnd*75+25;\q=rnd*75+25;}] in {1,...,50}
\fill [yellow!\p!orange!\q!blue]
(rand*4, rand*4) to [lightning bolt to] ++ (rand*180:rnd*4+2);
\end{tikzpicture}
\end{document}
The result is the same as before (apart from the randomness).