<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2017-03-29</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0001597313</issuerCik>
        <issuerName>ViewRay, Inc.</issuerName>
        <issuerTradingSymbol>VRAY</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0000315066</rptOwnerCik>
            <rptOwnerName>FMR LLC</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>245 SUMMER STREET</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>BOSTON</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>02210</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>1</isTenPercentOwner>
            <isOther>1</isOther>
            <otherText>See Remark 1</otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2017-03-29</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>J</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionTimeliness>
                <value></value>
            </transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>1105202</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>6884721</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See Footnote 1</value>
                    <footnoteId id="F1"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">F-Prime Capital Partners Healthcare Fund II LP (FPCPH) made a pro-rata distribution to its partners, without payment of consideration, of 2,500,000 shares of Viewray, Inc. previously reported by FMR LLC. FPCPH distributed 1,385,274 shares to Impresa Fund III Limited  Partnership (IFLP), 368,810 shares to F-Prime Capital Partners Healthcare Advisors Fund II LP (FPCPHA) and 745,916 shares to a recipient whose shares are not subject to reporting by the undersigned (an Other Recipient). FPCPHA made a pro-rata distribution to its partners, without payment of consideration, of 125,446 shares to F-Prime Inc., a wholly-owned subsidiary of FMR LLC, and 241,718 shares to Other Recipients. Finally, F-Prime Inc. made a distribution, without payment of consideration, of 117,568 shares to Other Recipients. As a result, FPCPH beneficially owns 5,489,923 shares, FPCPHA beneficially owns 1,646 shares, IFLP beneficially owns 1,385,274 shares and F-Prime Inc. beneficially owns 7,878 shares.</footnote>
    </footnotes>

    <remarks>Remark 1: Abigail P. Johnson is a Director, the Chairman and the Chief Executive Officer of FMR LLC. Members of the Johnson family, including Abigail P. Johnson, are the predominant owners, directly or through trusts, of Series B voting common shares of FMR LLC, representing 49% of the voting power of FMR LLC. The Johnson family group and all other Series B shareholders have entered into a shareholders' voting agreement under which all Series B voting common shares will be voted in accordance with the majority vote of Series B voting common shares. Accordingly, through their ownership of voting common shares and the execution of the shareholders' voting agreement, members of the Johnson family may be deemed, under the Investment Company Act of 1940, to form a controlling group with respect to FMR LLC. The address of Abigail P. Johnson is c/o FMR LLC, 245 Summer Street, Boston, MA 02110.
Remark 2: The general partner of F-Prime Capital Partners Healthcare Fund II LP is F-Prime Capital Partners Healthcare Advisors Fund II LP. F-Prime Capital Partners Healthcare Advisors Fund II LP and Impresa Fund III Limited Partnership are each solely managed by Impresa Management LLC, their general partner and investment manager. Impresa Management LLC is owned, directly or indirectly, by various shareholders and employees of FMR LLC, including certain members of the Johnson family.
Remark 3: The filing of this statement shall not be deemed to be an admission that, for purposes of Section 16 of the Securities Exchange Act of 1934 or otherwise, the undersigned are the beneficial owners of any securities reported herein.</remarks>

    <ownerSignature>
        <signatureName>Marc R. Bryant, Duly authorized under Powers of Attorney, by and on behalf of FMR LLC and its direct and indirect subsidiaries, and Abigail P. Johnson</signatureName>
        <signatureDate>2017-03-30</signatureDate>
    </ownerSignature>
</ownershipDocument>
