FPS Bullet spawn problem

Hi! My FPS is almost done, but i have a little problem that i wasn’t able to solve.
When i shoot with my gun, the bullet prefab spawn in the wrong direction, like in the image that i uploaded. No matter if i i change the direction of the prefab, when it spawns, it is in the wrong direction, making the bullet look like ridiculous! What i need to do so the bullet spawns in the right angle?

Here’s my shooting script:

using UnityEngine;
using System.Collections;

public class ShootDemo : MonoBehaviour
{
public Rigidbody projectile;
public float speed = 0;

// Update is called once per frame
void Update()
{
    if (Input.GetButtonDown("Fire1"))
    {
        Rigidbody instantiatedProjectile = Instantiate(projectile, transform.position, transform.rotation) as Rigidbody;
        instantiatedProjectile.velocity = transform.TransformDirection(new Vector3(0, 0, speed));
    }
}

}

I think you can find the answer in this unity tutorial: http://unity3d.com/learn/tutorials/modules/beginner/scripting/instantiate.
Add an empty gameobject with the right position and rotation, drag it into a public Transform variable in your script and use its transform position and rotation in the instantiate function.