PortalGun portals rotation problem

So I’m making portal-like game. Basic idea is this: Player can shoot orange and blue portal bullets. When bullet hits something, it teleports portal-gameobject to hit location. This works fine. But portal-object is always in the same rotation (horizontal). And I want it to rotate like in Portal 2 (or 1) (Valve game), ‘facing’ hit surface.

This is my BlueBullet script:

using UnityEngine;
using System.Collections;

public class CreatePortalBlue : MonoBehaviour {

	public GameObject PortalB;

	public void OnTriggerEnter( Collider col)
	{

			Vector3 impactPos = this.transform.position + new Vector3(0, 0.3f, 0);
			PortalB.transform.position = impactPos;
			//this works fine (move the portal)

			PortalB.transform.rotation = Quaternion.identity;
			//bad try to rotating portal. I have tried lot's of things.
			

			Destroy(gameObject);
			//destroy bullet

	}
}

just cast a ray at the surface of what you hit

portal.transform.rotation = quanternion.lookat(raycasthit.normal);

easy enough

you should wiki up surface normals for a greater understanding of why this works if you dont understand why.