When collider, add a rigibody to the gameobject

How i can add a rigibody to a gameobject with C#

i want add a rigibody to a wall when a rock collider with it. it´s like a catapult

The scrip:

using UnityEngine;
using System.Collections;

public class Choque : MonoBehaviour {
	void OnCollisionEnter (Collision vColisionando){
		if (vColisionando.gameObject.tag == "construccion"){
			vColisionando.AddComponent<Rigidbody> ();
	}
}

thing.gameObject.AddComponent();
you had it, but your problem is going to be that the rigidbody is added when the wall is hit, which means no force is added to your wall.
The solution is to cast a ray in the rocks trajectory (‘thing.rigidbody.velocity.normalized’)
and if the ray hits the wall, add the rigidbody and its properties

use gameObject.AddComponent();

Just be sure to check to make sure it has a rigidbody first. Though I’m not sure if adding a rigidbody as soon as the rock hits the wall is going to be enough time for physics to respond. I could be wrong - only one way to find out.