In Avengers: Age of Ultron, Thor channels lightning bolts into the "cradle" containing the still-inanimate form of Vision. Why? Was he hoping to kill it? To bring it to life? Either way, why did he want this outcome and what made him think lightning bolts would accomplish his goal?
Thor zapped the cradle in order to power it, and bring the Vision to life. The cradle was disconnected from power (and data) by Quicksilver while everyone else was arguing. The lightning provided the power needed, much like it did to the Iron Man suit in the previous Avengers movie.*
Thor says this outright, the the Vision is necessary for them to defeat Ultron:
Steve Rogers: Thor, you helped create this?
Thor: I've had a vision. A whirlpool that sucks in all hope of life and at it's center is that. [he points to the gem inside Vision's head]
Bruce Banner: What, the gem?
Thor: It's the Mind Stone. It's one of the six Infinity Stones, the greatest power in the universe, unparalleled in its destructive capabilities.
Steve Rogers: Then why would you bring it to...
Thor: Because Stark is right.
Bruce Banner: Oh, it's definitely the end times.
Thor: The Avengers cannot defeat Ultron.
Vision: Not alone.
Steve Rogers: Why does your "vision" sound like Jarvis?
Tony Stark: We...we reconfigured Jarvis' matrix to create something new.
Steve Rogers: I think I've had my fill of new.
Vision: You think I'm a child of Ultron?
Steve Rogers: You're not?
Vision: I'm not Ultron. I'm not Jarvis. I am...I am...
Wanda Maximoff: I looked in your head and saw annihilation.
Vision: Look again.
Clint Barton: Yeah. Her seal of approval means jack to me.
Thor: Their powers, the horrors in our heads, Ultron himself, they all came from the Mind Stone, and they're nothing compared to what it can unleash. But with it on our side...
(Stark's Position being that they should use the Vision in the way that he wanted to use Ultron, as protector of the Earth).
It was part of Thor's vision in the Waters earlier in the film. The extended version on dvd/bluray is slightly less confusing. But neither actually show the Vision in it. So all we have is Thor's word that he saw that the Vision would help. This also explains why Thor, the typical "Shoot first, shoot later" type of fighter didn't immediately attack the Vision when he was born.
*Considering that Thor was not present during the events revolving the cradle, why he knows it needs power or that his lightning would help instead of destroying it, let's pretend the vision from the well told him instead of it being a glaring plot hole.